11

We have a project using Typescript and Vue 3.1.5 and Vue CLI 5.0.0-beta.2 which in turn uses Webpack 5.47.0. For development the startup of vue-cli-service serve was really slow (lots of dependencies). So we activated the Webpack filesystem cache:

configureWebpack: {
  cache: {
    type: "filesystem",
  },
},

Now it works fine on Linux and MacOS. But on Windows it is often refreshing the whole cache after logging an exception:

[webpack.cache.PackFileCacheStrategy] Restoring pack from C:\Users\Smith\ws\kl\kl-frontend\node_modules.cache\webpack\default-development.pack failed: TypeError: Cannot read property 'hasStartTime' of undefined

Does anyone know what the issue could be? Maybe something to do with Filenames? We also have a job that deletes and then recreates some API files, usually with identical content. Could that throw off the caching?

wuerg
  • 1,022
  • 12
  • 12
  • 2
    Did you ever figure this out? I'm having the same problem now, October 23, 222. – user258081 Oct 23 '22 at 22:56
  • 2
    I'm running into this with next@13.2.1 on MacOS Ventura as well :/ – Luca Steeb Feb 26 '23 at 08:35
  • It sounds like the cache contains invalid/corrupt entries. Without a *runnable* [mcve] I have no way of looking closer into this. And I doubt webpack would issue a fix (which would be to find the offending line and use [optional chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining)). – tao Mar 31 '23 at 00:21
  • 4
    If the error persists, nuking the cache folder should solve it: `rm -rf node_modules/.cache`. For next users it should be: `rm -rf .next/cache` – tao Mar 31 '23 at 00:30
  • You may want to try disabling cache entirely. To do this, remove the cache section from your configureWebpack configuration, or set the type property to "memory" instead of "filesystem". – mario ruiz Apr 06 '23 at 12:33

0 Answers0