Permalink with accents : inconsistency between dev and build
See original GitHub issueLet’s say I have a permalink with an accent, for exemple /salamèche
.
In dev mode
, when I try to access the page, I get a Not Found
page.
When I build
, I get the correct path salamèche
in my public folder and I can access the page as expected.
I tried to wrap my permalink with encodeURI
function. It work now in dev mode
, when I build, it create the folder salam%C3%A8che
but I can’t access this page (with sirv-cli
), either with /salamèche
or /salam%C3%A8che
.
Elderjs: 1.2.4
Svelte: 3.29.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had more time to try it out, and it works indeed ! Just to recap if someone need it right now, this is the way to go:
add polka/url@next to your project:
yarn add polka/url@next
add the parser to your config in
src/server.js
:Just to confirm – that should be the fix since Polka is setting
req.path
whichsirv
then respects & uses, preventing its own decode.Your directory name should contain the special characters. It worked in dev because your filesystem also contained the special characters, but the in-memory FILES cache of
sirv
possessed keys like/salamèche
, but thereq.path
was sending the still-encoded/salam%C3%A8che
form.