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

AWS amplify build failed #2009

Closed
4 tasks done
PierreBalazuc opened this issue Jun 29, 2021 · 7 comments
Closed
4 tasks done

AWS amplify build failed #2009

PierreBalazuc opened this issue Jun 29, 2021 · 7 comments
Labels
archived This issue has been locked. ssr Server Side Rendering feature

Comments

@PierreBalazuc
Copy link

Before opening, please confirm:

App Id

d2y4s18nsmd981

Region

eu-central-1

Amplify Console feature

Custom builds

Describe the bug

Hello,

The bug come when i deploy my modification on git and then build by amplify. The build failed everytime at :
Starting SSR Build...

and i go this message :

Starting SSR Build...
2021-06-29T14:01:29.603Z [ERROR]: Error: 'Command failed with exit code 1: node_modules/.bin/next build',
command: 'node_modules/.bin/next build',
exitCode: 1,
signal: undefined,
signalDescription: undefined,
stdout: 'Loaded env from /codebuild/output/src615757906/src//.env\n' +
'warn - No build cache found. Please configure build caching for faster rebuilds. Read more: https://err.sh/next.js/no-cache\n' +
'info - Creating an optimized production build...\n' +
'Attention: Next.js now collects completely anonymous telemetry regarding usage.\n' +
"This information is used to shape Next.js' roadmap and prioritize features.\n" +
"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:\n" +
'https://nextjs.org/telemetry\n',
stderr: 'Browserslist: caniuse-lite is outdated. Please run:\n' +
'npx browserslist@latest --update-db\n' +
'Failed to compile.\n' +
'\n' +
"ModuleNotFoundError: Module not found: Error: Can't resolve 'net' in '/codebuild/output/src615757906/src/
/node_modules/tunnel-agent'\n" +
'\n' +
'\n' +
'> Build error occurred\n' +
'Error: > Build failed because of webpack errors\n' +
' at build (/codebuild/output/src615757906/src/***/node_modules/next/dist/build/index.js:15:918)\n' +
' at runMicrotasks ()\n' +
' at processTicksAndRejections (internal/process/task_queues.js:97:5)',
failed: true,
timedOut: false,
isCanceled: false,
Terminating logging...

4 days earlier i did a realease and everything work perfectly my app build with no error.
but today i can't get rid of this error. i search everything on the net but nothing work to resolve it.

I don't understant why next.js come here because i never used it in my project ( react app), and i don't understant why the build start to do "SSR Build". The last build (the worked one) , i look at the log and the command SSR BUILD is not used.

Everything were fine 4 days ago...
Does your guys have a solution for this ?

Expected behavior

Build success with no error like the 25 past succed build.

Reproduction steps

  1. deployed my code in Git
  2. automatic deployement with aws amplify

Build Settings

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - nvm use $VERSION_NODE_12
        - npm ci
    build:
      commands:
        - nvm use $VERSION_NODE_12
        - node -v
        - npm run-script build
  artifacts:
    baseDirectory: build
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*

Additional information

The last modification i did on my code where :

  • call a /Get with API gateway
  • install xml2js with npm
  • install node-fetch with npm

that all my changes

@siegerts siegerts added the ssr Server Side Rendering feature label Jun 29, 2021
@PierreBalazuc
Copy link
Author

PierreBalazuc commented Jun 29, 2021

Now i have this kind of error :

ModuleNotFoundError: Module not found: Error: Can't resolve 'fs' in '/codebuild/output/src914097980/src/***/node_modules/request/lib'\n" +

Always at "moduleNotFoundError"

@PierreBalazuc
Copy link
Author

Even if i backup and deploy the lastest succesful commit, i still got the error.

ModuleNotFoundError: Module not found: Error: Can't resolve 'fs' in '/codebuild/output/src914097980/src/***/node_modules/request/lib'\n" +

@Athena96
Copy link
Contributor

Hi all, we've recently made improvements to our SSR error logging and have added support for Next.js 10/11.
Please follow this guide to upgrade to our latest support of Next.js: https://docs.aws.amazon.com/amplify/latest/userguide/server-side-rendering-amplify.html#update-app-nextjs-version

@RealDrewKlayman
Copy link

This is directly related to:
#2098

@aws-amplify aws-amplify deleted a comment from github-actions bot Jul 28, 2021
@Jay2113
Copy link
Contributor

Jay2113 commented Mar 7, 2024

This issue is a duplicate of #2098 and it seems isolated to Next v11. We have since launched improved support for Next.js versions 12 and 13 so this should no longer be an issue.

@Jay2113 Jay2113 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 7, 2024
Copy link

github-actions bot commented Mar 7, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Copy link

github-actions bot commented Mar 7, 2024

This issue has been automatically locked.

@github-actions github-actions bot added the archived This issue has been locked. label Mar 7, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived This issue has been locked. ssr Server Side Rendering feature
Projects
None yet
Development

No branches or pull requests

5 participants