webpack-contrib/cache-loader

cache files are randomly corrupted

jooddang opened this issue · 7 comments

Hi,
I'm using cache-loader v1.0.3, and I love it for it saves a lot of webpack build time. (~1min)
The problem is that coworkers randomly experience build error of Empty files. It happens from our build machines a lot randomly, so we stopped using it recently. Can you find the root cause of it? Stack trace is as below:

Empty files:
ERROR in node_modules/.cache-loader-cache/1ab816c016e1bd0ed02e3712897f9d0d.json:1
1: 
^ Unexpected end of input
node_modules/.cache-loader-cache/46d561d9dbc4d7b6bb43238ffd0fea50.json:1
1: 
^ Unexpected end of input
node_modules/.cache-loader-cache/879d8d4764e11a424b407b0c5eb9b921.json:1
1: 
^ Unexpected end of input
node_modules/.cache-loader-cache/ec76dc763d9fbc22c5e4cc47972e2038.json:1
1: 
^ Unexpected end of input
node_modules/.cache-loader-cache/ed921eb0045f85051790b9a0c17f6868.json:1
1: 
^ Unexpected end of input
node_modules/.cache-loader-cache/fbb669036963f03d234002a129f75639.json:1
1: 
^ Unexpected end of input

@jooddang can you create minimum reproducible test repo? Thanks!

@evilebottnawi This is kinda bare minimum repo.
https://github.com/jooddang/cache-loader-test
The real repo is much more complex than this, but I guess this is what you would need for investigation.

Hi @evilebottnawi,
Can you take a look at this issue please?

@jooddang sorry for long answer, tomorrow i do this

@jooddang can't reproduce, which OS and node you use? Also i recommend to upgrade webpack to 3 version

well, even after webpack is upgraded to v3, it sporadically happens, not reproducible on my machine tho (reported from co-workers).
Is there possibility that can make trouble when webpack.watch() runs concurrently with express server (for HMR)?