Next.js: Version 9.3.2 breaks my zeit.co build

Created on 30 Mar 2020  路  6Comments  路  Source: vercel/next.js

Bug report

Last hotfix version breaks the zeit.co build.

Describe the bug

Update to next.js version 9.3.2 and try to deploy your application via zeit.co. The next build step fails with:

 Automatically optimizing pages...
 > Build error occurred
  _error_Error {
  props: "Cannot find module 'private-next-pages/index.spec.tsx'",
    context: undefined,
   refs: {},
 updater: {
    isMounted: [Function: isMounted],
    enqueueForceUpdate: [Function: enqueueForceUpdate],
   enqueueReplaceState: [Function: enqueueReplaceState],
   enqueueSetState: [Function: enqueueSetState]
  },
    code: 'MODULE_NOT_FOUND'
 }
...

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Setup a typescript based nextjs project
  2. Setup deployment in zeit.co
  3. Start deployment
  4. See error

Expected behavior

It should just work as before. After downgrade, it works again.

Most helpful comment

This error breaks also examples. I just copied blog-starter. Run npm install then npm run build and got this error:

Creating an optimized production build ..fs.js:885
  return binding.mkdir(pathModule._makeLong(path),
                 ^

Error: EEXIST: file already exists, mkdir '/home/polonium/www/cyclone/blog-starter/.next/cache/next-minifier'
    at fs.mkdirSync (fs.js:885:18)
    at new TaskRunner (/home/polonium/www/cyclone/blog-starter/node_modules/next/dist/build/webpack/plugins/terser-webpack-plugin/src/TaskRunner.js:1:634)
    at TerserPlugin.optimizeFn (/home/polonium/www/cyclone/blog-starter/node_modules/next/dist/build/webpack/plugins/terser-webpack-plugin/src/index.js:6:1316)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/polonium/www/cyclone/blog-starter/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:21:1)
    at AsyncSeriesHook.lazyCompileHook (/home/polonium/www/cyclone/blog-starter/node_modules/tapable/lib/Hook.js:154:20)
    at hooks.additionalAssets.callAsync.err (/home/polonium/www/cyclone/blog-starter/node_modules/webpack/lib/Compilation.js:1409:36)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/polonium/www/cyclone/blog-starter/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (/home/polonium/www/cyclone/blog-starter/node_modules/tapable/lib/Hook.js:154:20)
    at hooks.optimizeTree.callAsync.err (/home/polonium/www/cyclone/blog-starter/node_modules/webpack/lib/Compilation.js:1405:32)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/polonium/www/cyclone/blog-starter/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `next build`
npm ERR! Exit status 1

All 6 comments

What version were you on before? Do you have a deployment url we can look at?

This error breaks also examples. I just copied blog-starter. Run npm install then npm run build and got this error:

Creating an optimized production build ..fs.js:885
  return binding.mkdir(pathModule._makeLong(path),
                 ^

Error: EEXIST: file already exists, mkdir '/home/polonium/www/cyclone/blog-starter/.next/cache/next-minifier'
    at fs.mkdirSync (fs.js:885:18)
    at new TaskRunner (/home/polonium/www/cyclone/blog-starter/node_modules/next/dist/build/webpack/plugins/terser-webpack-plugin/src/TaskRunner.js:1:634)
    at TerserPlugin.optimizeFn (/home/polonium/www/cyclone/blog-starter/node_modules/next/dist/build/webpack/plugins/terser-webpack-plugin/src/index.js:6:1316)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/polonium/www/cyclone/blog-starter/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:21:1)
    at AsyncSeriesHook.lazyCompileHook (/home/polonium/www/cyclone/blog-starter/node_modules/tapable/lib/Hook.js:154:20)
    at hooks.additionalAssets.callAsync.err (/home/polonium/www/cyclone/blog-starter/node_modules/webpack/lib/Compilation.js:1409:36)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/polonium/www/cyclone/blog-starter/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (/home/polonium/www/cyclone/blog-starter/node_modules/tapable/lib/Hook.js:154:20)
    at hooks.optimizeTree.callAsync.err (/home/polonium/www/cyclone/blog-starter/node_modules/webpack/lib/Compilation.js:1405:32)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/polonium/www/cyclone/blog-starter/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `next build`
npm ERR! Exit status 1

While attempting to deploy using next@^9.1.6 on Heroku I came across the same error!

Resolved by upgrading to [email protected]. Really weird. Have deployed many Next apps on Heroku using 9.1.6.

now, the 9.3.1 fails as well :/

works with 9.3.4 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

havefive picture havefive  路  3Comments

kenji4569 picture kenji4569  路  3Comments

swrdfish picture swrdfish  路  3Comments

knipferrc picture knipferrc  路  3Comments

timneutkens picture timneutkens  路  3Comments