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

Docker builds are failing #9590

Closed
rajat1saxena opened this issue Dec 2, 2019 · 8 comments
Closed

Docker builds are failing #9590

rajat1saxena opened this issue Dec 2, 2019 · 8 comments
Labels
please add a complete reproduction Please add a complete reproduction.

Comments

@rajat1saxena
Copy link

Bug report

Describe the bug

I have installed version 9.1.4 of next and now my Docker images don't build anymore! I am getting the following error.

However when I run the next build command from my own terminal it works fine so it is only happening for the Docker setup.

Error

...
> frontend@1.0.0 build /usr/src/app
> next build

Creating an optimized production build...
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry


Failed to compile.

./node_modules/next/dist/client/next.js
Error: Cannot find module './src/data'
Require stack:
- /usr/src/app/node_modules/core-js-compat/helpers.js
- /usr/src/app/node_modules/core-js-compat/get-modules-list-for-target-version.js
- /usr/src/app/node_modules/@babel/preset-env/lib/polyfills/corejs3/usage-plugin.js
- /usr/src/app/node_modules/@babel/preset-env/lib/index.js
- /usr/src/app/node_modules/@babel/core/lib/config/files/plugins.js
- /usr/src/app/node_modules/@babel/core/lib/config/files/index.js
- /usr/src/app/node_modules/@babel/core/lib/index.js
- /usr/src/app/node_modules/babel-loader/lib/index.js
- /usr/src/app/node_modules/next/dist/build/webpack/loaders/next-babel-loader.js
- /usr/src/app/node_modules/loader-runner/lib/loadLoader.js
- /usr/src/app/node_modules/loader-runner/lib/LoaderRunner.js
- /usr/src/app/node_modules/next/node_modules/webpack/lib/NormalModule.js
- /usr/src/app/node_modules/next/node_modules/webpack/lib/NormalModuleFactory.js
- /usr/src/app/node_modules/next/node_modules/webpack/lib/Compiler.js
- /usr/src/app/node_modules/next/node_modules/webpack/lib/webpack.js
- /usr/src/app/node_modules/next/dist/build/compiler.js
- /usr/src/app/node_modules/next/dist/build/index.js
- /usr/src/app/node_modules/next/dist/cli/next-build.js
- /usr/src/app/node_modules/next/dist/bin/next

> Build error occurred
Error: > Build failed because of webpack errors
    at build (/usr/src/app/node_modules/next/dist/build/index.js:9:900)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frontend@1.0.0 build: `next build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the frontend@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-12-02T19_02_50_506Z-debug.log
ERROR: Service 'frontend' failed to build: The command '/bin/sh -c npm run build' returned a non-zero code: 1

System information

  • OS: Windows 10 Home
  • Version of Next.js: 9.1.4
@rodrimaia
Copy link

rodrimaia commented Dec 2, 2019

Getting the same error in a fresh project created by npx create-next-app

@rajat1saxena
Copy link
Author

My site is currently offline due to this.

@gtavidian
Copy link

😔

@riacoding
Copy link

I am also getting the same error in a fresh project created by npx create-next-app

@Timer Timer added the please add a complete reproduction Please add a complete reproduction. label Dec 2, 2019
@Timer
Copy link
Member

Timer commented Dec 2, 2019

Please follow the issue template and provide a reproducible demo. We cannot identify the bug in your code without it.

@Timer
Copy link
Member

Timer commented Dec 2, 2019

Seems this was due to a bad npm publish by someone in the ecosystem.

Be sure your Dockerfile is copying package-lock.json or yarn.lock -- this is likely your problem.

zloirock/core-js#710


For other users, run a yarn upgrade or npm upgrade to fix this.

@Timer Timer closed this as completed Dec 2, 2019
@Timer
Copy link
Member

Timer commented Dec 2, 2019

Seems NPM is suffering from a service outage/degradation and serving 1hr+ old content. This might take a while.
npm/cli#545

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
please add a complete reproduction Please add a complete reproduction.
Projects
None yet
Development

No branches or pull requests

6 participants