`Could not find source file` when running in watch mode with `rollup-plugin-vue`
See original GitHub issueWhat happens and why it is wrong
When running rollup in watch mode, the project will initially compile but changes to some files that trigger rollup watch, will cause a source file not found error from rp2:
[!] (plugin rpt2) Error: Could not find source file: '/<path removed>/watch-err/source/lib/module1.ts'.
Error: Could not find source file: '/<path removed>/watch-err/source/lib/module1.ts'.
at getValidSourceFile (/<path removed>/watch-err/node_modules/typescript/lib/typescript.js:153646:29)
at Object.getSyntacticDiagnostics (/<path removed>/watch-err/node_modules/typescript/lib/typescript.js:153896:52)
at /<path removed>/watch-err/node_modules/rollup-plugin-typescript2/src/index.ts:306:23
at TsCache.getDiagnostics (/<path removed>/watch-err/node_modules/rollup-plugin-typescript2/src/tscache.ts:298:49)
at TsCache.getSyntacticDiagnostics (/<path removed>/watch-err/node_modules/rollup-plugin-typescript2/src/tscache.ts:238:15)
at /<path removed>/watch-err/node_modules/rollup-plugin-typescript2/src/index.ts:304:15
at /<path removed>/watch-err/node_modules/rollup-plugin-typescript2/src/tscache.ts:183:61
at arrayEach (/<path removed>/watch-err/node_modules/rollup-plugin-typescript2/node_modules/lodash/lodash.js:516:11)
at Function._.each [as forEach] (/<path removed>/watch-err/node_modules/rollup-plugin-typescript2/node_modules/lodash/lodash.js:9368:14)
at TsCache.walkTree (/<path removed>/watch-err/node_modules/rollup-plugin-typescript2/src/tscache.ts:183:4)
Repository with reproduction code
Steps to reproduce:
- Run
rollup -c rollup.config.js --watch
- Trigger rollup watch by re-saving
module2.ts
orindex.ts
. Note that triggering watch withmodule1.ts
will not produce the error.
I assume this is related to the directory structure of the project which uses baseUrl
to point up to the “lib” dir. Also, I was not able to reproduce this without Vue.
Environment
MacOS 10.15 Node 16
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
Source file not found error when running in "watch" mode -
When running rollup in watch mode, the project will initially compile ... rollup watch, will cause a source file not found error from...
Read more >Bundling with Rollup - Vue.js 3 Course
In this article we will write a rollup config from scratch to compile a project written in TypeScript. Our goal will be three...
Read more >snowpack.config.js
Specifies the “mode” that Snowpack should run in. ... "test" : testOptions.files are not excluded, and will be scanned & built as normal...
Read more >Installation - Vue.js
You can browse the source of the NPM package at cdn.jsdelivr.net/npm/vue. Vue is also available on unpkg and cdnjs (cdnjs takes some time...
Read more >Configuring Vitest
VITEST or mode property on defineConfig (will be set to test ... and cannot fail before your running code, so you will most...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@agilgur5
Great news. Thank you for taking the time to fix this. I can go back to using rollup’s watch instead of relying on nodemon during development.
#364 has been released in
0.33.0