Skip to content

Cannot find module 'server/next-server' on vercel (11.0.2-canary.4) #26881

@gu-stav

Description

@gu-stav

What version of Next.js are you using?

11.0.2-canary.4

What version of Node.js are you using?

14

What browser are you using?

not relevant

What operating system are you using?

not relevant

How are you deploying your application?

next build

Describe the Bug

When running next build on vercel the following error is thrown:



20:22:28.588 | Error: Cannot find module 'next/dist/next-server/server/next-server'
-- | --
20:22:28.588 | Require stack:
20:22:28.588 | - /vercel/path0/noop.js
20:22:28.588 | at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
20:22:28.588 | at o (/vercel/0ade7bda7c20c71d/.build-utils/.builder/node_modules/@vercelruntimes/next/dist/index.js:1:568658)
20:22:28.588 | at a (/vercel/0ade7bda7c20c71d/.build-utils/.builder/node_modules/@vercelruntimes/next/dist/index.js:1:568769)
20:22:28.588 | at Object.e.exports [as default] (/vercel/0ade7bda7c20c71d/.build-utils/.builder/node_modules/@vercelruntimes/next/dist/index.js:1:568792)
20:22:28.588 | at Object.serverBuild (/vercel/0ade7bda7c20c71d/.build-utils/.builder/node_modules/@vercelruntimes/next/dist/index.js:1:629702)
20:22:28.588 | at Object.build (/vercel/0ade7bda7c20c71d/.build-utils/.builder/node_modules/@vercelruntimes/next/dist/index.js:1:606215)
20:22:28.588 | at buildStep (/var/task/webpack:/@zeit/api/scripts/build-container/src/utils/purpose-build.ts:164:1) {
20:22:28.588 | code: 'MODULE_NOT_FOUND',
20:22:28.588 | requireStack: [ '/vercel/path0/noop.js' ]
20:22:28.588 | }

It doesn't happen locally. I have disabled the build cache and ran a deployment multiple times. Could be related to #26734

Expected Behavior

The build should succeed.

To Reproduce

As an example you can use: https://vercel.com/seebruecke-org/frontend/Gg6EPQgVy3zCMak2BHGrdGNYFWjp

You'll find the error at the end of the logs. Please ignore the GraphQL error logs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue was opened via the bug report template.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions