You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to revert this replacement back to 'global' and build became working again
Logs
[nuxt] [request error] Cannot read properties of undefined (reading 'push')
at addRouteMiddleware (/C:/Projects/reproduction/.output/server/chunks/server.mjs:6816:40)
at /C:/Projects/reproduction/.output/server/chunks/server.mjs:8519:27
at callWithNuxt (/C:/Projects/reproduction/.output/server/chunks/server.mjs:6828:24)
at /C:/Projects/reproduction/.output/server/chunks/server.mjs:6836:30
at createApp (/C:/Projects/reproduction/.output/server/chunks/server.mjs:8676:15)
at async __webpack_exports__.default (/C:/Projects/reproduction/.output/server/chunks/server.mjs:8777:11)
at async renderToString (/C:/Projects/reproduction/.output/server/chunks/renderer.mjs:280:19)
at async /C:/Projects/reproduction/.output/server/chunks/renderer.mjs:613:20
at async /C:/Projects/reproduction/.output/server/node_modules/h3/dist/index.mjs:420:19
at async Server.nodeHandler (/C:/Projects/reproduction/.output/server/node_modules/h3/dist/index.mjs:370:7)
The text was updated successfully, but these errors were encountered:
BREAKING CHANGE: `nuxi generate` now behaves differently using nitro prerendering instead of the Nuxt 2 full-static approach. If you would like to keep the Nuxt 2 generation logic while still using nitro, you can run `nuxi generate --classic` or set `bridge.nitroGenerator` to `false`.
resolves#322, resolves#31, resolves#32, resolves#375, resolves#356
Environment
Windows_NT
v16.14.2
2.16.0-27606262.123206cb
npm@7.24.1
webpack
modules
,bridge
,buildModules
~/modules/middleware-module
@nuxt/bridge@3.0.0-27566698.2b0045e
Reproduction
https://github.com/AndreyYolkin/reproduction/tree/globalMiddleware
Describe the bug
When we try to dynamically insert global route middleware it causes error after running production build. In dev mode everything is ok
Additional context
Error probably locates in this string
after building for production
nuxtApp._middleware.global.push
turns intonuxtApp._middleware.globalThis.push
I tried to revert this replacement back to 'global' and build became working again
Logs
The text was updated successfully, but these errors were encountered: