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

with-http-2 example fails on Node v11.15.0 #8407

Closed
knight-of-zero opened this issue Aug 17, 2019 · 3 comments
Closed

with-http-2 example fails on Node v11.15.0 #8407

knight-of-zero opened this issue Aug 17, 2019 · 3 comments

Comments

@knight-of-zero
Copy link
Contributor

knight-of-zero commented Aug 17, 2019

Examples bug report

Example name

with-http-2

Describe the bug

The server crashes after you load the first page:

$ npm run dev

> with-http2@1.0.0 dev /home/username/next.js/with-http2-app
> node server.js

[ ready ] compiled successfully
[ wait ]  compiling ...
Listening on HTTPS port 3000
[ ready ] compiled successfully
[ event ] build page: /
[ wait ]  compiling ...
[ ready ] compiled successfully
/home/username/next.js/with-http2-app/node_modules/compression/index.js:84
        this._implicitHeader()
             ^

TypeError: this._implicitHeader is not a function
    at Http2ServerResponse.write (/home/username/next.js/with-http2-app/node_modules/compression/index.js:84:14)
    at ReadStream.ondata (_stream_readable.js:705:22)
    at ReadStream.emit (events.js:193:13)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:276:11)
    at ReadStream.Readable.push (_stream_readable.js:231:10)
    at fs.read (internal/fs/streams.js:183:12)
    at FSReqCallback.wrapper [as oncomplete] (fs.js:478:5)

To Reproduce

  1. Run npx create-next-app --example with-http2 with-http2-app
  2. Run cd with-http2-app
  3. Copy your SSL keys into localhost-privkey.pem and localhost-cert.pem.
  4. Run npm run dev
  5. Load https://localhost:3000/ in a browser and ignore the warning about self-signed certs.

Expected behavior

The page should load and the process keep running.

System information

OS: Ubuntu 18.04.3 LTS.
Node: I reproduced this on both v11.15.0 and v8.16.1.
Next.js cloned from master (commit 5422ee04bec6f2a582b3ce2f15b9edc30e755e13)

Additional context

Probably related to expressjs/compression#128

Disabling compression in the config, per the docs:

const app = next({
  dev,
  conf: {
    compression: false,
  }
})

did not fix the problem. I'm a bit suspicious that the docs are out of date too, because the typescript types don't mention this option... but that's an issue for another ticket.

@knight-of-zero
Copy link
Contributor Author

knight-of-zero commented Aug 17, 2019

ugh... I just found #8066

Looks like the docs have a bug. The setting is compress, not compression. And setting that to false does fix this problem. So probably not a problem specific to this example at all.

@knight-of-zero
Copy link
Contributor Author

Closing in lieu of #8408

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants