React crash (ReactCurrentDispatcher/ReactCurrentBatchConfig undefined) on Wasp 0.18
Frontend✅SolvedSaaS templateGeneral WaspDeploying
Hi everyone ,
I’m running into a blocking issue after deploying my Wasp 0.18 project to AWS (EC2 with Docker).
In production, when loading the app in the browser I get:
Uncaught TypeError: Cannot read properties of undefined(reading 'ReactCurrentBatchConfig')
Uncaught TypeError: Cannot read properties of undefined(reading 'ReactCurrentBatchConfig')
Later I also tried running locally and now I see a very similar error:
Uncaught TypeError: Cannot read properties of undefined(reading 'ReactCurrentDispatcher')
Uncaught TypeError: Cannot read properties of undefined(reading 'ReactCurrentDispatcher')
This happens right when the frontend bundle starts (before any API call). Backend and DB seem fine (no errors in logs).
Environment details:
Wasp 0.18
React 18 (declared in package.json)
React DOM 18 (same)
Using Docker for prod deploy on EC2
Nginx serves the assets fine, but the JS crashes instantly
Has anyone seen this error before with Wasp 0.18? Could this be caused by a mismatch between React/ReactDOM versions in the generated code or dependencies? Any advice on how to properly pin React for a Wasp project or avoid duplicate React installations would be really appreciated