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

adapter-node does not serve filenames that end with + #11766

Closed
hyunbinseo opened this issue Jan 31, 2024 · 2 comments
Closed

adapter-node does not serve filenames that end with + #11766

hyunbinseo opened this issue Jan 31, 2024 · 2 comments

Comments

@hyunbinseo
Copy link
Contributor

Describe the bug

static/academic-cap+.svg
static/academic-cap.svg
<img src="/academic-cap+.svg">
<img src="/academic-cap.svg">

Served in vite dev

Former is not served in vite preview and node build

Reproduction

https://stackblitz.com/edit/github-ilcgem?file=src%2Froutes%2F%2Bpage.svelte

npm run dev # works
npm run build
npm run preview # does not work
node build # does not work

Logs

SvelteKitError: Not found: /academic-cap+.svg
    at new SvelteKitError (/home/projects/github-ilcgem/build/server/index.js:1408:5)
    at resolve2 (/home/projects/github-ilcgem/build/server/index.js:4206:18)
    at resolve (/home/projects/github-ilcgem/build/server/index.js:4038:34)
    at #options.hooks.handle (/home/projects/github-ilcgem/build/server/index.js:4271:71)
    at respond (/home/projects/github-ilcgem/build/server/index.js:4036:43) {
  status: 404,
  text: 'Not Found'
}

System Info

System:
  OS: Linux 5.0 undefined
  CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Memory: 0 Bytes / 0 Bytes
  Shell: 1.0 - /bin/jsh
Binaries:
  Node: 18.18.0 - /usr/local/bin/node
  Yarn: 1.22.19 - /usr/local/bin/yarn
  npm: 10.2.3 - /usr/local/bin/npm
  pnpm: 8.14.0 - /usr/local/bin/pnpm
npmPackages:
  @sveltejs/adapter-node: ^4.0.1 => 4.0.1 
  @sveltejs/kit: ^2.3.3 => 2.5.0 
  @sveltejs/vite-plugin-svelte: ^3.0.1 => 3.0.2 
  svelte: ^4.2.8 => 4.2.9 
  vite: ^5.0.11 => 5.0.12

Severity

serious, but I can work around it

Additional Information

No response

@hyunbinseo
Copy link
Contributor Author

This is a sirv package issue.

Reproducible using the example provided in the Polka repository.

workspace
 ┣ public
 ┃ ┣ a+.txt - 404 Not Found
 ┃ ┗ a.txt -- Served
 ┣ index.js
 ┣ package.json
 ┗ pnpm-lock.yaml
// index.js
const polka = require('polka');

const { PORT = 3000 } = process.env;
const serve = require('sirv')('public');

polka()
  .use(serve)
  .get('/health', (req, res) => {
    res.end('OK');
  })
  .listen(PORT, () => {
    console.log(`> Running on localhost:${PORT}`);
  });

@hyunbinseo
Copy link
Contributor Author

Reference lukeed/sirv#159

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

1 participant