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

environment specific event handlers only work when method is also specified #2850

Closed
sandros94 opened this issue Nov 5, 2024 · 0 comments · Fixed by #2852
Closed

environment specific event handlers only work when method is also specified #2850

sandros94 opened this issue Nov 5, 2024 · 0 comments · Fixed by #2852
Labels
bug Something isn't working

Comments

@sandros94
Copy link
Contributor

sandros94 commented Nov 5, 2024

Environment

Node 20.18.0
Nitro 2.10.2

Reproduction

Create the following files:

  • routes/foo.get.dev.ts
  • routes/bar.dev.ts
  • routes/[id].dev.ts

Describe the bug

The current implementation checks for an environment specific suffix only when the related method is also specified. This results in the following outcomes:

  • routes/foo.get.dev.ts correctly doesn't get bundled into production.
  • routes/bar.dev.ts erroneously gets bundled into production.
  • if we check event.context.params for routes/[id].dev.ts we get { 'id.dev': 'value' } instead of { 'id': 'value' }.

Additional context

No response

Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants