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

Parameters in server cannot be three characters long. #13722

Closed
jhughes-dev opened this issue Apr 13, 2022 · 1 comment
Closed

Parameters in server cannot be three characters long. #13722

jhughes-dev opened this issue Apr 13, 2022 · 1 comment

Comments

@jhughes-dev
Copy link

Environment

  • Operating System: Windows_NT
  • Node Version: v16.14.0
  • Nuxt Version: 3.0.0-27496606.e43ba6e
  • Package Manager: npm@8.5.2
  • Builder: vite
  • User Config: typescript, privateRuntimeConfig
  • Runtime Modules: -
  • Build Modules: -

Reproduction

I have a server folder with

server/api/[uid].get.ts

I just return the context.params

export default defineEventHandler( async ( event ) => {
    console.log(event.context.params)
    event.res.end(JSON.stringify(event.context.params))
})

This is empty, but if I change it to
server/api/[name].get.ts

I see parameter returned. I tried a few different four letter words and they seem to work. One and two letter words work. longer names work.

Describe the bug

parameter names with three letters are ignored by the server. Interestingly, the route is still hit, but the parameter isn't available in context.

Additional context

No response

Logs

No response

@danielroe danielroe added nitro and removed nuxt3 labels Apr 13, 2022
@pi0 pi0 added bug and removed pending triage labels Apr 13, 2022
pi0 referenced this issue in nitrojs/nitro Apr 13, 2022
@pi0
Copy link
Member

pi0 commented Apr 13, 2022

Hi. This issue should be fixed in nitropack@v0.2.8. Please try upgrading using npx nuxi upgrade --force.

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

3 participants