You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Routes with file extensions are not being handled correctly. Currently, when using the route function with a path that includes a file extension, such as /:id.pdf, and providing an id parameter, the resulting path remains unchanged.
run npm install && npm run routes-gen && npm run dev
Click on any of the two generated pdf links on the index page ("Download Foo as a pdf")
You will get an 404
I have created a route called $id[.pdf].tsx (intended to be a resource route for downloading pdfs) route('/:id.pdf', {id: 'foo'}) passes type checks but the resulting path is wrong (:id.pdf)
Expected behavior
The :id placeholder in the path should be replaced with the provided id parameter, resulting in a path like /foo.pdf.
Describe the bug
Routes with file extensions are not being handled correctly. Currently, when using the route function with a path that includes a file extension, such as
/:id.pdf
, and providing an id parameter, the resulting path remains unchanged.Your Example Website or App
https://stackblitz.com/edit/node-yxbgqj?file=package.json,app%2Froutes%2F%24id[.pdf].ts
Steps to Reproduce the Bug or Issue
On the stackblitz example
npm install && npm run routes-gen && npm run dev
I have created a route called $id[.pdf].tsx (intended to be a resource route for downloading pdfs)
route('/:id.pdf', {id: 'foo'})
passes type checks but the resulting path is wrong (:id.pdf
)Expected behavior
The
:id
placeholder in the path should be replaced with the providedid
parameter, resulting in a path like/foo.pdf
.Screenshots or Videos
No response
Platform
Additional context
This naming convention with file extension is suggested by remix here: https://remix.run/docs/en/main/guides/resource-routes
The text was updated successfully, but these errors were encountered: