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

Frontend build failed after upgrading to version 6 of @aws-amplify/ui-react #3867

Closed
5 tasks done
phreitom opened this issue Dec 20, 2023 · 5 comments
Closed
5 tasks done
Labels
archived This issue has been locked. pending-triage

Comments

@phreitom
Copy link

Before opening, please confirm:

  • I have checked to see if my question is addressed in the FAQ.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.

App Id

d1vtcqqxsqn607

AWS Region

us-west-2

Amplify Hosting feature

Frontend builds

Frontend framework

React

Next.js version

N/A

Next.js router

App Router

Describe the bug

I upgraded to version 6 of @aws-amplify/ui-react
My app is running fine on my local environment.
I kicked off a new build and it failed on the front end build portion.

                                npm ERR! g++: error: unrecognized command line option ‘-std=c++2a’; did you mean ‘-std=c++03’?
                                npm ERR! make: *** [Release/obj.target/re2/lib/addon.o] Error 1
                                npm ERR! gyp ERR! build error
                                npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2

2023-12-20T01:14:00.793Z [WARNING]: npm ERR! gyp ERR! stack at ChildProcess. (/codebuild/output/src4045285886/src/rhyteit/node_modules/node-gyp/lib/build.js:209:23)
npm ERR! gyp ERR! System Linux 4.14.291-218.527.amzn2.x86_64
npm ERR! gyp ERR! command "/root/.nvm/versions/node/v16.19.0/bin/node" "/codebuild/output/src4045285886/src/rhyteit/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /codebuild/output/src4045285886/src/rhyteit/node_modules/re2
npm ERR! gyp ERR! node -v v16.19.0
npm ERR! gyp ERR! node-gyp -v v10.0.1
npm ERR! gyp ERR! not ok
npm ERR! node:internal/process/promises:279
npm ERR! triggerUncaughtException(err, true /* fromPromise */);
npm ERR! ^
npm
2023-12-20T01:14:00.793Z [WARNING]: ERR!
npm ERR! [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "1".] {
npm ERR! code: 'ERR_UNHANDLED_REJECTION'
npm ERR! }
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]

                                npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
                                npm ERR! g++: error: unrecognized command line option ‘-std=c++2a’; did you mean ‘-std=c++03’?
                                npm ERR! make: *** [Release/obj.target/re2/lib/addon.o] Error 1
                                npm ERR! gyp ERR! build error
                                npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
                                npm ERR! gyp ERR! stack at ChildProcess.<anonymous> (/codebuild/output/src4045285886/src/rhyteit/node_modules/node-gyp/lib/build.js:209:23)
                                npm ERR! gyp ERR! System Linux 4.14.291-218.527.amzn2.x86_64
                                npm ERR! gyp ERR! command "/root/.nvm/versions/node/v16.19.0/bin/node" "/codebuild/output/src4045285886/src/rhyteit/node_modules/.bin/node-gyp" "rebuild"
                                npm ERR! gyp ERR! cwd /codebuild/output/src4045285886/src/rhyteit/node_modules/re2
                                npm ERR! gyp ERR! node -v v16.19.0
                                npm ERR! gyp ERR! node-gyp -v v10.0.1
                                npm ERR! gyp ERR! not ok

To be honest...I don't even know where to begin to look on this one.front-end

Expected behavior

I expected the front-end build to succeed and my code to be pushed to production.

Reproduction steps

Upgrade from @aws-amplify/ui-react v4 to v6.
I went through all the code migrations and tested everything to make sure that the application worked properly.
Kick off the build process by checking in code from Visual Code.

Build Settings

version: 1
backend:
  phases:
    build:
      commands:
        - '# Execute Amplify CLI with the helper script'
        - update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.8 11
        - /usr/local/bin/pip3.8 install --user pipenv
        - amplifyPush --simple
frontend:
  phases:
    preBuild:
      commands:
        - npm ci
    build:
      commands:
        - npm run build
  artifacts:
    baseDirectory: build
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*

Log output

# Put your logs below this line
I uploaded the build log
[BuildLog_122023_1014.txt](https://github.com/aws-amplify/amplify-hosting/files/13729935/BuildLog_122023_1014.txt)

Additional information

None

@phreitom
Copy link
Author

Hi :))....help :))

@phreitom
Copy link
Author

Hi just trying to make sure this doesn't migrate to the bottom of the list. I have no idea what to do on this one. Need help.

@phreitom
Copy link
Author

On the Build Image Settings, I tried setting the Node.js version to 18. Now, the build process keeps failing telling me that the There was an issue connecting to your repo provider, click "Reconnect repository" in General Settings, and then try your build again. I rehook it up and it fails again with same "Reconnect..." message. If I remove Node JS version from Build Image Settings...then I am back to square one with original error

Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

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

This issue has been automatically locked.

@github-actions github-actions bot added the archived This issue has been locked. label Dec 27, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived This issue has been locked. pending-triage
Projects
None yet
Development

No branches or pull requests

1 participant