Closed jaydubb12 closed 8 months ago
I got this problem after upgrading to 14.1.1, this did not happen with the previous release:
runtime.js:13 Uncaught TypeError: Cannot read properties of undefined (reading 'injectIntoGlobalHook')
at eval (runtime.js:13:19)
at (:3000/node_modules/next/dist/compiled/@next/react-refresh-utils/dist/runtime.js (http://localhost:3000/_next/static/chunks/main-app.js?v=1709570710124:50:1)
at options.factory (webpack.js?v=1709570710124:716:31)
at __webpack_require__ (webpack.js?v=1709570710124:37:33)
at __webpack_exec__ (main-app.js?v=1709570710124:2256:61)
at main-app.js?v=1709570710124:2257:37
at webpackJsonpCallback (webpack.js?v=1709570710124:1388:39)
at main-app.js?v=1709570710124:9:61
This line is failing:
var runtime_1 = __importDefault(__webpack_require__(/*! next/dist/compiled/react-refresh/runtime */
"(app-pages-browser)/../../node_modules/next/dist/compiled/react-refresh/runtime.js"));
var helpers_1 = __importDefault(__webpack_require__(/*! ./internal/helpers */
"(app-pages-browser)/../../node_modules/next/dist/compiled/@next/react-refresh-utils/dist/internal/helpers.js"));
// Hook into ReactDOM initialization
runtime_1.default.injectIntoGlobalHook(self);
Deleted all caches (.next und node_modules/.cache) and tried to disable turbo but always keeps failing.
Well, downgraded to 14.1.0 and added the browserlist workaround again. Now it was running. Then upgraded to 14.1.1 and with the browserlist workaround it was still working.
So the workaround is adding this line to package.json:
"browserslist": [
"Chrome 118"
]
This was supposed to be fixed in 14.1.1: https://github.com/vercel/next.js/issues/60890
@huozhi please check this issue again.
The reproduction works for me even with 14.1.0.
We had some fixes for react-refresh runtime erros in 14.1.1, would like to see a different reproduction that can hit the error if it still bothers you 🙏
My case seems to be different. Last time I could not reproduce it in a test case. I guess this one is difficult to reproduce too.
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Link to the code that reproduces this issue
https://github.com/jaydubb12/next14
To Reproduce
cd test-app
yarn dev
exports is not defined
Current vs. Expected behavior
Current Behavior
Next v14.1 is causing unexpected build & dependency errors due to breaking changes
Expected Behavior
v14.1 would result in a
no harm
release that would not impact current / new projectsProvide environment information
Which area(s) are affected? (Select all that apply)
Module resolution (CJS / ESM, module resolving)
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local)
Additional context
I have tested against the canary version and the behavior is the same