'Error occured in react.production.min.js after deploying react app to the aws amplify
I've made complex react app but after deploying it on aws amplify i've got these errors, i don't know why i got these errors, on local it works perfectly here is the error log
Error: Minified React error #321; visit https://reactjs.org/docs/error-decoder.html?invariant=321 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at j (react.production.min.js:18)
at t.useContext (react.production.min.js:22)
at oe (hooks.js:18)
at Lu (Body.js:18)
at li (react-dom.production.min.js:157)
at Gl (react-dom.production.min.js:267)
at Is (react-dom.production.min.js:250)
at Bs (react-dom.production.min.js:250)
at Ms (react-dom.production.min.js:250)
at bs (react-dom.production.min.js:243)
ul @ react-dom.production.min.js:216
Uncaught Error: Minified React error #321; visit
https://reactjs.org/docs/error-decoder.html? react-dom.production.min.js:260
invariant=321 for the full message or use
the non-minified dev environment for full errors and additional helpful warnings.
at j (react.production.min.js:18)
at t.useContext (react.production.min.js:22)
at oe (hooks.js:18)
at Lu (Body.js:18)
at li (react-dom.production.min.js:157)
at Gl (react-dom.production.min.js:267)
at Is (react-dom.production.min.js:250)
at Bs (react-dom.production.min.js:250)
at Ms (react-dom.production.min.js:250)
at bs (react-dom.production.min.js:243)
if you know any solution or way to solve these kind of errors please answer it here! thanks :)
Solution 1:[1]
so here is the answer of this question! in package.json, i moved react and react-dom to peerDependencies
"peerDependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
so try this, it should solved the problem ;)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Dhruvin Prajapati |
