Next.js: Compiling client fails silently on "npm run dev", node debugger gives an error of missing file in the .cache directory

Created on 3 Jan 2019  路  3Comments  路  Source: vercel/next.js

Bug report

Describe the bug

When I run "npm run dev" my project works just fine but sometimes it suddenly stop working altogether. Restarting the server does nothing as the compiling of the client will be hanging silently without yielding any error.

However, when I run the node built-in debugger I get the following error:
no such file or directory, open '\node_modules\.cache\autodll-webpack-plugin\development_instance_0_4021edab164f5110f7f0f6b239caf46a\dll_902c0d8e342f4a2f6d51.js'

A quick investigation of the .cache folder gives the following structure:

.cache
 - autodll-webpack-plugin
    - development_instance_0_4021edab164f5110f7f0f6b239caf46a
      |- stats.json
    - development_instance_0_b224c84b1c3b29e9abccd88f69b9b5e2
      |- dll_902c0d8e342f4a2f6d51.js
      |- stats.json
      |- dll.manifest.json

So basically what happens is that the needed file dll_902c0d8e342f4a2f6d51.js somehow ends up in the wrong directory. Deleting the 'empty' folder development_instance_0_4021edab164f5110f7f0f6b239caf46a solves the problem but said problem keeps on coming back (with different folder names).

To Reproduce

I do not manage to reproduce it, it arise seemingly randomly when I am normally going on with the following workflow:

  1. Modify a .js file in /components or in /pages
  2. Modify a .scss file
  3. Save the modified files

System information

  • OS: tested on W7 and w10
  • Browser: firefox
  • Version of Next.js: 7.0.2

Additional context

I have a feeling that it is related to webpack so here is my super basic next.config.js file:

const withSass = require('@zeit/next-sass');

module.exports = withSass({
  sassLoaderOptions: {
    outputStyle: 'compressed',
    includePaths: [
      'node_modules/material-components-web/node_modules/',
      'node_modules/'
    ]
  }
});

Most helpful comment

npm install autodll-webpack-plugin --save seemed to work for me

All 3 comments

autodll-webpack-plugin was removed

Was a solution to this ever found? Having the same issue. On latest next.js 9.1.4.

npm install autodll-webpack-plugin --save seemed to work for me

Was this page helpful?
0 / 5 - 0 ratings