Skip to content

Static files with spaces or underscores in the file name don't work with adapter-node #740

@PaulHobbs

Description

@PaulHobbs

Describe the bug
Static files with a space or underscores don't get served by adapter-node.

Logs
No logs available, just a 404 from the node server.

To Reproduce
Add a static file with a space in it, like so: PaulHobbs@28ce49c

The file will be served correctly from the dev server, but return a 404 from the built node server (when run with npm run build && cd build && node .).

Expected behavior
Static with spaces should be served by the built node server correctly.

Stacktraces
N/A

Information about your SvelteKit Installation:

  • The output of npx envinfo --system --npmPackages svelte,@sveltejs/kit --binaries --browsers
  System:
    OS: macOS 11.0.1
    CPU: (8) arm64 Apple processor
    Memory: 117.89 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 15.5.1 - /opt/homebrew/bin/node
    npm: 7.3.0 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 89.0.4389.90
    Firefox: 86.0.1
    Safari: 14.0.1
  • Your browser
    Tested with Chrome and curl.

  • Your adapter (e.g. Node, static, Vercel, Begin, etc...)
    Node

Severity
Blocking an upgrade from Sapper to SvelteKit. I have a site with extensive use of static files with spaces, and the file names are used semantically (to determine the titles of the images), so removing the spaces is not an option.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions