-
Notifications
You must be signed in to change notification settings - Fork 544
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
route files with -
in param name are not scanned
#2868
Comments
will add to docs a bit later and open pr - if i understand correctly kebab-case not supported. what should api call return? |
Update: Seems a bug with scanner. runtime matcher supports You can use a custom config like this to allow param export default defineNitroConfig({
handlers: [
{
route: "/test/:test-param",
handler: "routes/test/[test-param].ts",
},
],
}); |
closed other warning pr then - is this the issue then |
would be happy to test - sorry to bug by asking. How can i get nitro working locally - for some reason when running pnpm install I get failed better-sqlite error? |
I made #2872 as fix in the meantime, and should be shortly fixed in nightly channel. I think you need to update your Node.js version (to 20 works for me) then use |
-
in param name are not scanned
Thanks for report and reproduction! |
thanks you are amazing! |
Environment
latest Nuxt 3.14.159
node 23.1
Reproduction
https://github.com/moshetanzer/nitro-server-route-bug
Describe the bug
Hi,
Hope you are well.
I came across the above bug - not sure if it done like this on purpose.
A route with a dynamic param that contains a dash returns as 404 for example
[my-token].get.ts
On Nuxt side (routing) it is normalized to
mytoken
Couldn't find documented anywhere not to use kebab case.
Would maybe suggest normalizing it like Nuxt does (with frontend routing) - just to ensure consistency between the two.
@danielroe any thoughts?
Thanks so much for your work!
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: