-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
this._implicitHeader is not a function #2754
Comments
Hello @738623786. Please provide a online reproduction by codesandbox or a minimal GitHub repository. Issues labeled by |
@738623786 Please respect our Issue Template |
I have the same issue and found the reason. The culprit is the compression module for express which does not support http2: Support for Node.js 8 native http2 The preview module of vite serve does use compress. When I start chrome with the parameter I guess reproduction of this error needs a combination of a recent Chrome browser and Node . I use Chrome 89 and Node 14 LTS. |
I patched vite locally in my node_modules folder according to the following commit which unfortunately was never merged into compress: [Fix usage of undocumented _implicitHeader and _header] This fixed the error |
Great finding @gunters63! Maybe you could do a PR to expressjs/compression showing this use case, it would be great if this was fixed. I'll reopen this issue with a |
Issue 122 is already unresolved now for 4 years. If I understand correctly, there are still some hard to solve stability problems regarding compress and HTTP/2 which is why the proposed fix was never merged. So I don't think it makes sense to send a PR request to the compression maintainers. I would suggest making the use of compress in vites server cli configurable, something like:
|
I wrote a comment now in the corresponding issue of compression. |
I also replaced |
Hey I'm having this issue with a basic templated vite project, is there ever going to be a solution to this? When exactly does |
When we disable the HTTPS this error does not happen. |
Using Node 16.12.0 here. I've encountered this behavior: |
would be nice if someone could provide a full reproduction in gtihub repo with os/browser details. |
Here's a StackBlitz sandbox (requires browser's WebContainer support) that's connected to a GH repo
You might encounter some issues running My experience, can reproduce in any browser other than Firefox every time 100% on Windows 11 & MacOS 12.0.1. In Firefox, it's either a Private Browsing tab or after some interaction with the app, idk. P.S. For Safari, Apple's using the 5000 port for their system stuff for some reason, so to get around it, you can add |
vite preview still fails with node v14.18.3 when the https server option enabled. Node.js v14.18.3 Error: TypeError: this._implicitHeader is not a function |
@Andrevwvm I am also seeing this behavior, my setup is utilizing |
Any fix for this yet? |
Yes. #6557 |
Visit "http://localhost:5000" after running "npm run serve",I get the following error:
xxx\node_modules\vite\dist\node\cli.js:13753
this._implicitHeader();
^
TypeError: this._implicitHeader is not a function
at Http2ServerResponse.end (xxx\node_modules\vite\dist\node\cli.js:13753:14)
at Array.write (xxx\node_modules\vite\dist\node\chunks\dep-0776dd57.js:49039:9)
at listener (xxx\node_modules\vite\dist\node\chunks\dep-0776dd57.js:48312:15)
at onFinish (xxx\node_modules\vite\dist\node\chunks\dep-0776dd57.js:48243:5)
at callback (xxx\node_modules\vite\dist\node\chunks\dep-0776dd57.js:48104:10)
at Http2ServerRequest.onevent (xxx\node_modules\vite\dist\node\chunks\dep-0776dd57.js:48142:5)
at Http2ServerRequest.emit (events.js:315:20)
at endReadableNT (_stream_readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
The text was updated successfully, but these errors were encountered: