NX Vite/React app can’t find __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED property

  Kiến thức lập trình

I have a NX repo with two NextJS app and two Vite/ReactJS apps in them. The Vite/ReactJS apps are already running on production. I have ported one of the NextJS apps into the NX repo got it to work with the Vite/ReactJS apps in dev but when I deploy to AWS Amplify OR build and serve the production app on local it throws an error in the console.

Uncaught TypeError: Cannot read properties of undefined (reading '__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED') at react-dom-6zTEHFzz.js:17:5363

I can’t make out what’s changed which caused this. I have added some new packages and upgraded some existing ones so the NextJS app runs. I am running "react-dom": "18.2.0" and "react": "18.2.0" versions.

My guess is that one of the packages I added or updated is causing this issue. Other than that, I am not sure where to look.

P.S: I can provide more info if someone wants to help or has an idea how to approach this.