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

Conflict with Node new version: stream_base_commons.js:62 var err = req.handle.writev(req, chunks, allBuffers); #343

Closed
bbagherian opened this issue Sep 27, 2018 · 4 comments

Comments

@bbagherian
Copy link

I installed Nodejs on a new system with all dependencies just yesterday, so all packages are almost updated. However I get the error below with this simple code:

Node version: v10.11.0
OS: Debian 9.4 (x86-64)

Code:

'use strict';

const express = require('express');
var spdy = require('spdy'),
fs = require('fs');


const hostname = '0.0.0.0';
const port = 3030;

var options = {
  key: fs.readFileSync(__dirname + '/test.key'),
  cert: fs.readFileSync(__dirname + '/test.cert'),

  spdy: {
    protocols: [ 'h2', 'spdy/3.1', 'http/1.1' ],
    plain: false,
    'x-forwarded-for': true,
 
    connection: {
      windowSize: 1024 * 1024, 
      autoSpdy31: false
    }
  }
};
 
var server = spdy.createServer(options, function(req, res) {
  res.writeHead(200);
  res.write('a');
  res.end('hello world!');
});


server.listen(port, hostname, () => {
  console.log('Server running');
});

Error:

internal/stream_base_commons.js:62
  var err = req.handle.writev(req, chunks, allBuffers);
                       ^

TypeError: req.handle.writev is not a function
    at writevGeneric (internal/stream_base_commons.js:62:24)
    at Socket._writeGeneric (net.js:711:5)
    at Socket._writev (net.js:720:8)
    at doWrite (_stream_writable.js:408:12)
    at clearBuffer (_stream_writable.js:517:5)
    at Socket.Writable.uncork (_stream_writable.js:314:7)
    at Socket.Writable.end (_stream_writable.js:584:10)
    at Socket.end (net.js:544:31)
    at ServerResponse.end (/........./Node/node_modules/spdy/lib/spdy/response.js:77:15)
    at Server.<anonymous> (/................../Node/test.js:64:7)
@coolaj86
Copy link

coolaj86 commented Oct 9, 2018

Fix is here: GrishaevPavel/spdy-transport@c33ebe7

And here, actually: #342

@smcelhinney
Copy link

This seems to happen on Node 10+ 100% of the time, and Node 10.x is now LTS as of today. Are there plans to patch to resolve?

@johntran
Copy link

johntran commented Nov 5, 2018

@coolaj86 I tried applying that fix and it only works on node 10.5.0. I'm able to replicate that error on 10.13.0.

I wish I can reply back with a solution for higher versions of Node but I haven't had the time to investigate it further. I ended up downgrading back to 10.5.0 and putting this issue on the backlog to investigate later.

@jacobheun
Copy link
Contributor

This is fixed in 4.0.0 via #351

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

No branches or pull requests

5 participants