Cannot find module with vue and brunch after edit


i´m new to vue so it might be me. I´ve parent.vue and child.vue. Making changes to parent.vue leads to “Cannot find module child.vue in parent.vue”. In the cmd it says: compiled parent.vue and 37 cached files into app.js in 524 ms. However, after restarting the phoenix server and 2-3 page refreshes everything works again. Child is imported with import Child from './child.vue'

Info: Changing child. vue works without any error

Brunch: 2.10.12
Elixir: 1.6.6
Pheonix: 1.3
Vue: 2.5.16

Any ideas?

I think this is actually a problem with how Brunch is rebuilding your scripts when a Vue component changes. I have a similar setup, both with Phoenix and without Phoenix and regularly experience this problem. I’ve so far been unable to resolve this problem myself event though there is an entry in Brunch’s troubleshooting guide addressing this issue:

If you are running brunch watch and change something, to later find out that the changed file was included as completely empty… what do you do?
It is caused by the way some editors write to files. It also can happen when you edit files over ssh. You can see these threads for more details:


Solved it:

Using Sublime Text with atomic_save: true and following brunch config option:

watcher: {
  awaitWriteFinish: true,
  usePolling: true

thank you