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

http2 causes issues with node 6.3.1 #197

Closed
stevejhiggs opened this issue Jul 25, 2016 · 4 comments · Fixed by #198
Closed

http2 causes issues with node 6.3.1 #197

stevejhiggs opened this issue Jul 25, 2016 · 4 comments · Fixed by #198

Comments

@stevejhiggs
Copy link
Contributor

Although this is actually an issue with the http2 module. If there was a flag to switch off the http2 support it would let me work around our issue.

Steps to reproduce:

running node 6.3.1 on windows.
run connect to serve a file over https.
browse to the file.

The following error occurs:

`buffer.js:1028
throw new TypeError('"value" argument is out of bounds');
^

TypeError: "value" argument is out of bounds
at checkInt (buffer.js:1028:11)
at Buffer.writeUInt16BE (buffer.js:1097:5)
at Function.writeCommonHeader as commonHeader
at Serializer._transform (C:\code\github\script-build-service\node_modules\http2\lib\protocol\framer.js:44:27)
at Serializer.Transform._read (_stream_transform.js:167:10)
at Serializer.Transform._write (_stream_transform.js:155:12)
at doWrite (_stream_writable.js:307:12)
at writeOrBuffer (_stream_writable.js:293:5)
at Serializer.Writable.write (_stream_writable.js:220:11)
at Compressor.ondata (_stream_readable.js:556:20)`

@justinmchase
Copy link
Collaborator

I believe if it fails to load via require it just uses default http. You could move it to an optional dependency and then not install it on your device machine

@stevejhiggs
Copy link
Contributor Author

The http2 module is loaded so gulp-connect attempts to use it then crashes out.

Is the intention to have a user optionally install the http2 module if they want http2 support? If so the optional dependancy should be a peer dependancy. Optional dependancies will alway be installed but installation failure is tolerated.

@stevejhiggs stevejhiggs changed the title http2 causes issues on windows http2 causes issues with node 6.3.1 Jul 26, 2016
@stevejhiggs
Copy link
Contributor Author

updated the title because it looks like an issue in node 6.3.1 rather than windows. see molnarg/node-http2#214

@justinmchase
Copy link
Collaborator

PR's welcome.

You could also use proxyquire to solve this fyi.

var proxyquire = require('proxyquire').noPassThru()
var gc = process.platform === 'win32' ? proxyquire('gulp-connect', { 'http2': null }) : require('gulp-connect')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants