liuweiGL / vite-plugin-mkcert

Provide certificates for vite's https dev service.
https://www.npmjs.com/package/vite-plugin-mkcert
MIT License
585 stars 38 forks source link

Status message is not supported by HTTP/2 #92

Closed alexadrien closed 2 months ago

alexadrien commented 2 months ago

Describe the bug

Vite dev server is showing a UnsupportedWarning in the console when the dev server starts.

> remix vite:dev

  ➜  Local:   https://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
(node:22811) UnsupportedWarning: Status message is not supported by HTTP/2 (RFC7540 8.1.2.4)
(Use `node --trace-warnings ...` to show where the warning was created)

Reproduction

I created a new Remix project using npx create-remix@latest . and then I installed vite-plugin-mkcert. You can find the bare-minimum repository here : https://github.com/alexadrien/httpsbugrepro

When running npm run dev, the warning is displayed :

(node:22811) UnsupportedWarning: Status message is not supported by HTTP/2 (RFC7540 8.1.2.4)
(Use `node --trace-warnings ...` to show where the warning was created)

System Info

Output of npx envinfo --system --npmPackages vite,vite-plugin-mkcert --binaries --browsers:

  System:
    OS: macOS 14.5
    CPU: (8) arm64 Apple M2
    Memory: 441.88 MB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.5.0 - ~/.nvm/versions/node/v20.5.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v20.5.0/bin/yarn
    npm: 10.2.0 - ~/.nvm/versions/node/v20.5.0/bin/npm
  Browsers:
    Chrome: 126.0.6478.182
    Edge: 125.0.2535.79
    Safari: 17.5
  npmPackages:
    vite: ^5.1.0 => 5.3.4 
    vite-plugin-mkcert: ^1.17.5 => 1.17.5 

Used package manager: npm

Logs

(node:22811) UnsupportedWarning: Status message is not supported by HTTP/2 (RFC7540 8.1.2.4)
(Use `node --trace-warnings ...` to show where the warning was created)

Do you have any idea on how to solve this warning ?

Thanks for the plugin, it's amazing to easily have https on dev environment !!

liuweiGL commented 2 months ago

I am unable to run the demo you provided with version v21.7.1 of node.js, I think you can seek help under the Remix repository.

> remix vite:dev

  ➜  Local:   https://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
10:01:48 [vite] Internal server error: Headers.set: ":method" is an invalid header name.
      at webidl.errors.exception (node:internal/deps/undici/undici:2414:14)
      at webidl.errors.invalidArgument (node:internal/deps/undici/undici:2425:28)
      at _Headers.set (node:internal/deps/undici/undici:3038:31)
      at fromNodeHeaders (C:\Users\wei24\Downloads\httpsbugrepro-master\node_modules\@remix-run\dev\dist\vite\node-adapter.js:30:17)
      at Object.fromNodeRequest (C:\Users\wei24\Downloads\httpsbugrepro-master\node_modules\@remix-run\dev\dist\vite\node-adapter.js:45:14)
      at nodeHandler (C:\Users\wei24\Downloads\httpsbugrepro-master\node_modules\@remix-run\dev\dist\vite\plugin.js:840:39)      
      at C:\Users\wei24\Downloads\httpsbugrepro-master\node_modules\@remix-run\dev\dist\vite\plugin.js:844:21
alexadrien commented 2 months ago

Thanks for your answer! Closing this issue