nitro icon indicating copy to clipboard operation
nitro copied to clipboard

Route params parsed incorrectly when it contains literals or multiple params

Open SilentDepth opened this issue 1 year ago • 0 comments

Environment

Nitro: 0.5.4 Node: 16.14.2

Reproduction

https://stackblitz.com/edit/nitro-8ovcqq?file=routes/one/%5Ba%5D.json.ts

Describe the bug

/routes/[a].json.js

URL: /foo.json Expected params: { "a": "foo" } Actual params: { "a.json": "foo.json" }

/routes/[a]-[b].js

URL: /foo-bar Expected params: { "a": "foo", "b": "bar" } Actual params: { "a-:b": "foo-bar" }

/routes/hello-[a].js

URL: /hello-foo Expected params: { "a": "foo" } Actual response: 404

Additional context

No response

Logs

No response

SilentDepth avatar Sep 24 '22 16:09 SilentDepth