tajo / ladle

🥄 Develop, test and document your React story components faster.
https://www.ladle.dev
MIT License
2.63k stars 93 forks source link

Internal server error: Header name must be a valid HTTP token [":path"] #536

Closed wojtekmaj closed 3 months ago

wojtekmaj commented 12 months ago

Describe the bug

When using Ladle + vite-plugin-ssl with server.proxy, the following error appears on the server:

Internal server error: Header name must be a valid HTTP token [":path"]

I initially thought it's a regression of https://github.com/vitejs/vite/issues/484, but turns out it's not: workaround for https://github.com/vitejs/vite/issues/484 is still there. I dug down inside Ladle stuff and confirmed that the issue lies here:

https://github.com/tajo/ladle/blob/ff434ef02204bda9c19660edf358d151ac16a23d/packages/ladle/lib/cli/vite-dev.js#L134-L135

This piece of code lacks the exact same workaround Vite lacked back in the days.

When I replaced these two lines of code with:

      https
        .createServer(

Ladle + vite-plugin-ssl started working flawlessly with server.proxy.

Environment

System:
    OS: macOS 14.1.1
    CPU: (8) arm64 Apple M2
    Memory: 59.30 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.9.0 - /private/var/folders/3y/swkjq1x101b76mzjgt4pm2d80000gp/T/xfs-7e9663ff/node
    Yarn: 4.0.0 - /private/var/folders/3y/swkjq1x101b76mzjgt4pm2d80000gp/T/xfs-7e9663ff/yarn
    npm: 10.1.0 - /usr/local/bin/npm
    bun: 1.0.12 - ~/.bun/bin/bun
  Browsers:
    Chrome: 119.0.6045.159
    Edge: 119.0.2151.72
    Safari: 17.1
Sanket-Arekar commented 12 months ago

I would like to work on this issue. Can you Please assign me this issue?

tajo commented 12 months ago

I would like to work on this issue. Can you Please assign me this issue?

Sure, thanks!