kit: Routes with umlauts are not found in node builds

Describe the bug

When you create a route that has an umlaut in it, for example “über-uns” and you reload the page, you get a 404 Not found. This only happens when you run the build created by the adapter-node, preview and dev work as expected.

Reproduction

https://github.com/noahsalvi/kit-umlaut-repro

install deps; npm run build; node build/

Logs

http://localhost:3000/hell%C3%B6 404 (Not Found)

System Info

System:
    OS: macOS 11.5
    CPU: (8) x64 Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz
    Memory: 58.57 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.4.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.18.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 92.0.4515.131
    Edge: 91.0.864.71
    Firefox: 82.0.3
    Safari: 14.1.2
  npmPackages:
    @sveltejs/adapter-node: next => 1.0.0-next.39 
    @sveltejs/kit: next => 1.0.0-next.146 
    svelte: ^3.34.0 => 3.42.1

Severity

serious, but I can work around it

Additional Information

The problem is that the adapter-node parses the url which encodes the umlaut characters, resulting in the route not being found.

Meaning const parsed = new URL(......) should be removed and replaced with just using req.path and new URLSearchParams(req.query)

I could make a pull request if needed.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 24 (17 by maintainers)

Commits related to this issue

Most upvoted comments

It does a production build of your JS, etc. But it can’t actually run in production on all the various platforms. I don’t know how you’d mirror the Vercel, Netlify, platforms, etc. Maybe integrating with their dev tools. But thus far that’s been a TODO

I get this:

Screenshot from 2021-08-13 09-17-45