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

Error when building frontend with React 18 #3470

Closed
Aidan199916 opened this issue May 9, 2023 · 4 comments
Closed

Error when building frontend with React 18 #3470

Aidan199916 opened this issue May 9, 2023 · 4 comments
Labels
archived This issue has been locked. pending-triage transferred This issue was transferred from another Amplify project

Comments

@Aidan199916
Copy link

Hello all, I am new to React and am attempting to build a Portfolio website with React, hosting it in Amplify. When deploying, I keep running into the same error. Listed below is my build log errors.

Executing command: npm ci
2023-05-09T14:36:45.728Z [WARNING]: npm ERR!
2023-05-09T14:36:45.729Z [WARNING]: code ERESOLVE
2023-05-09T14:36:45.730Z [WARNING]: npm
2023-05-09T14:36:45.732Z [WARNING]: ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @material-ui/[email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react-dom
npm ERR! react-dom@"^18.2.0" from the root project
npm ERR! peer react-dom@"^17.0.0 || ^18.0.0" from @mui/[email protected]
npm ERR! node_modules/@mui/base
npm ERR! @mui/base@"5.0.0-alpha.128" from @mui/[email protected]
npm ERR! node_modules/@mui/lab
npm ERR! @mui/lab@"^5.0.0-alpha.129" from the root project
npm ERR! @mui/base@"5.0.0-alpha.128" from @mui/[email protected]
npm ERR! node_modules/@mui/material
npm ERR! @mui/material@"^5.12.3" from the root project
npm ERR! 2 more (@mui/icons-material, @mui/lab)
npm ERR! 5 more (@mui/lab, @mui/material, @testing-library/react, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-dom@"^16.8.0 || ^17.0.0" from @material-ui/[email protected]
npm ERR! node_modules/@material-ui/core
npm ERR! @material-ui/core@"^4.12.4" from the root project
npm ERR! peer @material-ui/core@"^4.0.0" from @material-ui/[email protected]
npm ERR! node_modules/@material-ui/icons
npm ERR! @material-ui/icons@"^4.11.3" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/react-dom
npm ERR! peer react-dom@"^16.8.0 || ^17.0.0" from @material-ui/[email protected]
npm ERR! node_modules/@material-ui/core
npm ERR! @material-ui/core@"^4.12.4" from the root project
npm ERR! peer @material-ui/core@"^4.0.0" from @material-ui/[email protected]
npm ERR! node_modules/@material-ui/icons
npm
2023-05-09T14:36:45.732Z [WARNING]: ERR! @material-ui/icons@"^4.11.3" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

I have tried both --force and --legecy-peer-deps to no avail. Any help or suggestions would be very appreciated. 
@reesscot reesscot transferred this issue from aws-amplify/amplify-ui May 9, 2023
@reesscot reesscot added the transferred This issue was transferred from another Amplify project label May 9, 2023
@reesscot
Copy link

reesscot commented May 9, 2023

From the above, it looks like @material-ui/core requires react-dom 17 and below whereas @mui/base requires react-dom 17 or 18. I would try removing the old @material-ui/core dependencies and install the new ones. See: https://mui.com/material-ui/getting-started/installation/

@Aidan199916
Copy link
Author

@reesscot I appreciate you taking the time to look into what I am working on. Are there any other methods to remove @material-ui ?

@github-actions
Copy link

github-actions bot commented May 9, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot added the archived This issue has been locked. label May 10, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 10, 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 transferred This issue was transferred from another Amplify project
Projects
None yet
Development

No branches or pull requests

2 participants