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 Spdy: stream_base_commons.js:62 var err = req.handle.writev(req, chunks, allBuffers); #23130

Closed
bbagherian opened this issue Sep 27, 2018 · 3 comments
Labels
wrong repo Issues that should be opened in another repository.

Comments

@bbagherian
Copy link

bbagherian commented Sep 27, 2018

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)
@mscdex
Copy link
Contributor

mscdex commented Sep 27, 2018

This issue tracker is for reporting bugs in node core and submitting feature requests for node core.

General help questions should be posted to the nodejs/help issue tracker instead.

Issues with third-party modules, npm, or other tools that use node, should be posted to the appropriate issue tracker for that project, unless it can be proven that the issue is in fact with node core and not the module/tool in question.

@mscdex mscdex closed this as completed Sep 27, 2018
@mscdex mscdex added the wrong repo Issues that should be opened in another repository. label Sep 27, 2018
@bbagherian
Copy link
Author

related issue: ##21665

@addaleax
Copy link
Member

@behzadba See spdy-http2/node-spdy#333 for some more information on the causes of this issue. tl;dr: spdy is essentially unmaintained and even if this issue were fixed it’s a super-fragile implementation, so avoid using it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wrong repo Issues that should be opened in another repository.
Projects
None yet
Development

No branches or pull requests

3 participants