Skip to content
New issue

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

Layers: Server middlewares are no longer ordered by filename #26890

Open
max06 opened this issue Apr 22, 2024 · 2 comments
Open

Layers: Server middlewares are no longer ordered by filename #26890

max06 opened this issue Apr 22, 2024 · 2 comments

Comments

@max06
Copy link

max06 commented Apr 22, 2024

Environment

  • Operating System: Linux
  • Node Version: v20.11.0
  • Nuxt Version: 3.11.2
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.6
  • Package Manager: bun@1.1.3
  • Builder: -
  • User Config: devtools, extends, modules, nitro, tailwindcss, ui
  • Runtime Modules: @nuxt/ui, @nuxtjs/color-mode, @nuxtjs/tailwindcss, @pinia/nuxt@^0.5.1, nuxt-monaco-editor@^1.2.7, @nuxt/test-utils/module@^3.12.0
  • Build Modules: -

Reproduction

  • Have a nuxt app using at least one layer besides the main app.
  • Create a server middleware in main app omega.ts doing simple console.log("I am omega")
  • Create a server middleware in layer alpha.ts doing simple console.log("I am alpha")
  • Run any request against server endpoint

Describe the bug

The reproduction shows omega before alpha.

Additional context

Use case: Layer auth takes care about adding user information to event context. Main app middleware does rough access control by user role requiring that context.

I can add a repro next weekend if necessary.

Logs

No response

@danielroe
Copy link
Member

This seems like a nitro behaviour change rather than Nuxt.

Would you see if you can reproduce this in pure Nitro (reproduction sandbox), and if so, raise there? 🙏

@max06
Copy link
Author

max06 commented Apr 23, 2024

Yeah, I can do that! Will report back once I've got to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants