Vue-cli: Running serve twice without code changes breaks any of the typescript templates.

Created on 29 Jan 2018  路  5Comments  路  Source: vuejs/vue-cli

Version

3.0.0-alpha.4

Reproduction link

http://I-do-not-have-a-link

Steps to reproduce

1) Run vue create project, any settings that includes typescript will do.

2) "cd project" and npm run serve It compiles and runs without errors.

3) Stop the process (ctrl-break) and run once more: npm run serve.

What is expected?

It's expected to compile and run again without errors.

What is actually happening?

It throws an error:
Module build failed: Error: Could not find file: '/var/www/test/src/App.vue'. at getValidSourceFile (/var/www/test/node_modules/typescript/lib/typescript.js:95642:23) at Object.getEmitOutput (/var/www/test/node_modules/typescript/lib/typescript.js:96002:30) at Object.getEmitOutput (/var/www/test/node_modules/ts-loader/dist/instances.js:155:41) at getEmit (/var/www/test/node_modules/ts-loader/dist/index.js:172:35) at successLoader (/var/www/test/node_modules/ts-loader/dist/index.js:42:11) at Object.loader (/var/www/test/node_modules/ts-loader/dist/index.js:29:12)


I assume this is a cache-issue, since making any script changes and running again fixes the problem temporarily. I've tried all combinations of babel polyfills on/off and class style decorators on/off, on win10 and centos 7, giving the same results.

Most helpful comment

@ravjsdev yeah, I've noticed that yesterday as well, but it should be fixed for real in the next release ;)

All 5 comments

the same issue.
3.0.0-alpha.4 on windows 10,

It helps only to clear ../node_modules/.cache before each run serve command

I get the same issue after executing command npm run serve for the second time - the initial run works fine

the error i get states:

 error  in ./src/views/Home.vue

Module build failed: Error: Could not find file: '******* /Documents/vuetest/src/views/Home.vue'.

After clearing cache as per @buzzzzer's comment I am then able to execute npm run serve command successfully.

Thanks, this is known and fixed in dev branch, alpha.5 will be out today.

@yyx990803 this issue still occurs and i'm using alpha.5 - the only difference now is it doesn't occur on the 2nd time npm run serve is executed - it seems to randomly occur - i think maybe i ran npm run serve a few times and now get Error: Could not find file: '/Users/*****/Documents/trak/src/views/Home.vue' - deleting the .cache folder resolves the issue temporarily until it happens again.

@ravjsdev yeah, I've noticed that yesterday as well, but it should be fixed for real in the next release ;)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brunoseco picture brunoseco  路  35Comments

deanilvincent picture deanilvincent  路  38Comments

joeirimpan picture joeirimpan  路  35Comments

italomaia picture italomaia  路  88Comments

ghenry picture ghenry  路  40Comments