We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Darwin
v20.7.0
3.8.2
3.9.1
2.8.0
yarn@3.5.1
-
extends
alias
dir
typescript
app
components
imports
https://stackblitz.com/edit/github-zx3fux
Using global middlewares with Nuxt Layers will not retain the alphabetical order based on the file names.
In my repodruction my nuxt-app project extends base-layer.
nuxt-app
base-layer
Global middlwares in nuxt-app:
00.main.global.ts
Global middlwares in base-layer:
01.base.global.ts
Expcted order:
Actual order:
Check logs in the reproduction.
Currently I fixed the issue by using plugins to register the middlewares in the right order: Base Plugin:
// base-layer/plugins/00.global-middleware-fix.ts export default defineNuxtPlugin(() => { globalBaseMiddlewares.forEach((middleware, index) => addRouteMiddleware(`00-${index}`, middleware, { global: true })) })
Main Plugin:
// plugins/00.global-middleware-fix.ts export default defineNuxtPlugin(() => { globalMainMiddlewares.forEach((middleware, index) => addRouteMiddleware(`00-${index}`, middleware, { global: true })) })
Related stackoverflow post: https://stackoverflow.com/questions/77826748/order-of-middlewares-in-nuxt3-layers
No response
The text was updated successfully, but these errors were encountered:
Start a new pull request in StackBlitz Codeflow.
Sorry, something went wrong.
fix(nuxt): sort global middleware on layers, close nuxt#25891
d173c61
Successfully merging a pull request may close this issue.
Environment
Darwin
v20.7.0
3.8.2
3.9.1
2.8.0
yarn@3.5.1
-
extends
,alias
,dir
,typescript
,app
,components
,imports
-
-
Reproduction
https://stackblitz.com/edit/github-zx3fux
Describe the bug
Using global middlewares with Nuxt Layers will not retain the alphabetical order based on the file names.
In my repodruction my
nuxt-app
project extendsbase-layer
.Global middlwares in
nuxt-app
:00.main.global.ts
Global middlwares in
base-layer
:01.base.global.ts
Expcted order:
00.main.global.ts
01.base.global.ts
Actual order:
01.base.global.ts
00.main.global.ts
Check logs in the reproduction.
Currently I fixed the issue by using plugins to register the middlewares in the right order:
Base Plugin:
Main Plugin:
Additional context
Related stackoverflow post: https://stackoverflow.com/questions/77826748/order-of-middlewares-in-nuxt3-layers
Logs
No response
The text was updated successfully, but these errors were encountered: