Skip to content
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

Having a + (plus) sign in assets’ paths potentially breaks SvelteKit in some server environments (PHP) #6029

Closed
malinowskip opened this issue Aug 18, 2022 · 2 comments

Comments

@malinowskip
Copy link
Contributor

Describe the bug

I have encountered a scenario in which assets generated by SvelteKit can’t be imported by the app due to the + (plus) sign being in the generated paths (after the routing update).

I have a setup in which a few pages of my Laravel app are generated by adapter-static. In production, assets would be served by Nginx, but the development environment relies on the built-in PHP server. After upgrading SvelteKit, I started getting weird redirects for all assets whose paths contained the + (plus) sign, e.g. +page-3508b0bd.css. It turns out that the PHP server treats the + (plus) character as a space (source)

I know it’s technically fine to use an unescaped + sign in a path, but it seems there might be edge cases where this causes problems.

Reproduction

Serve a statically-generated SvelteKit app (post-routing update) using the built-in PHP server.

Logs

No response

System Info

System:
    OS: macOS 12.5
    CPU: (8) arm64 Apple M1
    Memory: 91.08 MB / 16.00 GB
    Shell: 3.5.1 - /opt/homebrew/bin/fish
  Binaries:
    Node: 18.7.0 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.15.0 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 104.0.5112.79
    Edge: 104.0.1293.54
    Firefox: 104.0
    Firefox Developer Edition: 104.0
    Safari: 15.6
  npmPackages:
    @sveltejs/vite-plugin-svelte: 1.0.0-next.41 => 1.0.0-next.41
    svelte: ^3.49.0 => 3.49.0
    vite: 2.9.5 => 2.9.5

Severity

blocking an upgrade

Additional Information

No response

@benmccann
Copy link
Member

This is essentially the same issue as #5843

@Conduitry
Copy link
Member

Yup I think we can close this in favor of #5843. The solution will presumably be the same.

@Conduitry Conduitry closed this as not planned Won't fix, can't repro, duplicate, stale Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants