vue-cli-service build does not update or invalidate node_modules/.cache, resulting in broken build
See original GitHub issueVersion
3.0.1
Node and OS info
node v8.9.3 / npm 6.4.1 / Windows 10
Steps to reproduce
I have the app A which has dependency B. A uses B’s sources, thus B is in vue.config.js as transpiled:
transpileDependencies: ["B"]
- in A:
vue-cli-service build --modern
builds app and creates node_modules/.cache - in B: change code, increase version, and publish it to npm repo
- in A: change B’s version in package.json
- in A:
npm update B
, which updates node_modules/B - in A: increase version
- in A:
vue-cli-service build --modern
What is expected?
A/dist should correspond to A’s and B’s sources.
What is actually happening?
A/dist is the same (same hashes, same content), as in the previous build
If I manually delete node_modules/.cache, and run the build again, then it works - the dist content corresponds to the sources.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:16 (4 by maintainers)
Top Results From Across the Web
Compiling error when building Vue project after Node/dev ...
Unfortunately I have no other ideas on this issue for the moment, I believe it is a breaking change that occurred when you...
Read more >@vue/cli-service | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >Mastering Browser Cache - Vue School Blog
Learn how to master browser cache to improve the performance of your Vue.js applications.
Read more >just an fyi, delete your .cache folder before release build : r/vuejs
Delete .cache folder in node_modules before building release version. ... Dev version was working perfectly but Prod build did not.
Read more >Bug listing with status RESOLVED with resolution OBSOLETE ...
(was: =dev-java/jdbm-1.0 is available)" status:RESOLVED resolution:OBSOLETE ... Bug:123318 - "net-dns/avahi won't build w/o X connection (related to pygtk)" ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top 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
Workaround:
npm install rimraf --save-dev
In package.json add the prebuild script:
Kind of clumsy, but better than corrupted build.
What options do we have?
dependencies
,devDependencies
andpeerDependencies
fields as inputs to the chache-key generating code (e.g. here. But that wouldn’t work for updated nested dependencies (i.e. clearingyarn.lock
and reinstalling, adding updated dependencies in the processvue-cli-service build --clearCache
or something).Other ideas? @sodatea