-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Closed
Labels
Description
Describe the bug
The dev server always responds "Invalid request body"
The original issue can be found at sveltejs/kit#11213.
I believe the problem lies in the incompatibility between the vite dev server and HTTP/2, which is the default protocol when using HTTPS.
While many people only use HTTP on their dev servers to avoid this issue, we have specific cookie strategies that require both our dev server and production server to use HTTPS.
UPDATE: I recently upgraded to SvelteKit 2 (which is using Vite 5) and Node.js v21.5.0, the issue persists with a different error message:
TypeError: Headers.append: ":method" is an invalid header name.
at webidl.errors.exception (node:internal/deps/undici/undici:1636:14)
at webidl.errors.invalidArgument (node:internal/deps/undici/undici:1647:28)
at appendHeader (node:internal/deps/undici/undici:2053:29)
at fill (node:internal/deps/undici/undici:2039:11)
at new Request (node:internal/deps/undici/undici:6151:13)
Reproduction
https://github.com/hronro/vite-https-issue
Steps to reproduce
- Run
pnpm i
- Run
pnpm dev
- Open the page in browser
System Info
System:
OS: Linux 6.6 Arch Linux
CPU: (14) x64 AMD Ryzen 7 5800X 8-Core Processor
Memory: 26.50 GB / 27.41 GB
Container: Yes
Shell: 3.7.0 - /usr/bin/fish
Binaries:
Node: 21.5.0 - /usr/bin/node
Yarn: 1.22.21 - /usr/bin/yarn
npm: 10.2.5 - /usr/bin/npm
pnpm: 8.13.1 - /usr/bin/pnpm
npmPackages:
vite: ^5.0.10 => 5.0.10
Used Package Manager
pnpm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
jrmoynihan