Next.js: Error after upgrading from 9.3.6 to 9.4

Created on 12 May 2020  路  12Comments  路  Source: vercel/next.js

Bug report

Describe the bug

Upgrading next from 9.3.6 to 9.4.0, then running npm run dev is throwing an error.

To Reproduce

Upgrade next.js + npm run dev.

Screenshots

error - ./node_modules/next/dist/next-server/lib/side-effect.js
Module not found: Can't resolve '@babel/runtime/helpers/assertThisInitialized' in '/Users/aroca/front/node_modules/next/dist/next-server/lib'
Error: Cannot find module '/Users/aroca/front/.next/server/static/development/pages/_document'
Require stack:
- /Users/aroca/front/node_modules/next/dist/next-server/server/load-components.js
- /Users/aroca/front/node_modules/next/dist/next-server/server/api-utils.js
- /Users/aroca/front/node_modules/next/dist/next-server/server/next-server.js
- /Users/aroca/front/node_modules/next/dist/server/next.js
- /Users/aroca/front/server/server.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1014:15)
    at Function.Module._resolveFilename (/Users/aroca/front/node_modules/module-alias/index.js:49:29)
    at Function.Module._load (internal/modules/cjs/loader.js:884:27)
    at Module.require (internal/modules/cjs/loader.js:1074:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.loadComponents (/Users/aroca/front/node_modules/next/dist/next-server/server/load-components.js:24:25)
    at DevServer.findPageComponents (/Users/aroca/front/node_modules/next/dist/next-server/server/next-server.js:567:60)
    at DevServer.renderErrorToHTML (/Users/aroca/front/node_modules/next/dist/next-server/server/next-server.js:861:33)
    at DevServer.renderErrorToHTML (/Users/aroca/front/node_modules/next/dist/server/next-dev-server.js:22:915)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async DevServer.render (/Users/aroca/front/node_modules/next/dist/next-server/server/next-server.js:552:22)
    at async Object.fn (/Users/aroca/front/node_modules/next/dist/next-server/server/next-server.js:402:17)
    at async Router.execute (/Users/aroca/front/node_modules/next/dist/next-server/server/router.js:134:32)
    at async DevServer.run (/Users/aroca/front/node_modules/next/dist/next-server/server/next-server.js:517:29)
    at async DevServer.handleRequest (/Users/aroca/front/node_modules/next/dist/next-server/server/next-server.js:153:20) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/aroca/front/node_modules/next/dist/next-server/server/load-components.js',
    '/Users/aroca/front/node_modules/next/dist/next-server/server/api-utils.js',
    '/Users/aroca/front/node_modules/next/dist/next-server/server/next-server.js',
    '/Users/aroca/front/node_modules/next/dist/server/next.js',
    '/Users/aroca/front/server/server.js'
  ]
}

As more details, I'm using Preact + custom server.

System information

  • OS: macOS
  • Version of Next.js: 9.4.0
  • Version of Node.js: 14.0.0
please add a complete reproduction

Most helpful comment

i have similar error, but cannot find ./next/build-manifest.json for mine
(just cache/ and server/ folders are created in .next/, no static/ or jsons)
trying to reproduce on minimal repo but no luck so far, did anyone find workaround for this?

All 12 comments

I also often encounter errors after upgrade to the new Next.js version.
To resolve to remove yarn.lock and reinstall.

@nghiepit removing yarn.lock is not solving the problem in this case (because I already did it! heh).

@aralroca Have you tried deleting the .next directory and running npm run dev again?

Same @taylorbryant . Doing rm -rf node_modules package-lock.json .next && npm i && npm run dev the error stills hapenning.

i have similar error, but cannot find ./next/build-manifest.json for mine
(just cache/ and server/ folders are created in .next/, no static/ or jsons)
trying to reproduce on minimal repo but no luck so far, did anyone find workaround for this?

We need a full reproduction to help track this down. 馃檹

@Timer you have access to the repo: https://github.com/vinissimus/frontend

To reproduce it: just upgrade Next.js to 9.4.1 + npm run dev

@aralroca you seem to be breaking your own compilation in next.config.js by aliasing @babel/runtime to a package that doesn't exist:

        '@babel/runtime': path.resolve(
          __dirname,
          'node_modules/next/node_modules/@babel/runtime'
        ),

Ouh! I'm glad it's not a Next.js problem. Thank you very much and I'm sorry I didn't find it.

Not a problem! Let us know how Fast Refresh works for you 馃檹

I just tried and looks that is not working. I guess that is because it is a React feature that is not landed in Preact yet?

Oh, that'd be the case yes @aralroca. Can you use real React in development?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

olifante picture olifante  路  3Comments

jesselee34 picture jesselee34  路  3Comments

irrigator picture irrigator  路  3Comments

renatorib picture renatorib  路  3Comments