Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Need example of how to use custom server.js with with-docker #44903

Open
bradydean opened this issue Jan 15, 2023 · 0 comments
Open

Docs: Need example of how to use custom server.js with with-docker #44903

bradydean opened this issue Jan 15, 2023 · 0 comments

Comments

@bradydean
Copy link

What is the improvement or update you wish to see?

I'm having issues using a custom server.js with the with-docker example.

node:internal/modules/cjs/loader:408
      throw err;
      ^

Error: Cannot find module '/app/node_modules/next/dist/server/next.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (node:internal/modules/cjs/loader:400:19)
    at Function.Module._findPath (node:internal/modules/cjs/loader:613:18)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:981:27)
    at Function.Module._load (node:internal/modules/cjs/loader:841:27)
    at Module.require (node:internal/modules/cjs/loader:1067:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (/app/server.js:4:14)
    at Module._compile (node:internal/modules/cjs/loader:1165:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1219:10)
    at Module.load (node:internal/modules/cjs/loader:1043:32) {
  code: 'MODULE_NOT_FOUND',
  path: '/app/node_modules/next/package.json',
  requestPath: 'next'
}

To reproduce

  1. Clone with-docker
  2. Add a server.js eg from here
  3. Add COPY server.js ./server.js as the last COPY in the final build step.

Is there any context that might help us understand?

I need an example of how to use a custom server.js with the with-docker example.

Does the docs page already exist? Please link to it.

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant