http2-express-bridge
http2-express-bridge copied to clipboard
Exception: `Cannot destructure property 'socket' of '(intermediate value)(intermediate value)(intermediate value)' as it is undefined.`
Not sure what caused this, but I figured I'd at least drop a note here in case it helps…
I just saw my server die with this exception:
"message": "Cannot destructure property 'socket' of '(intermediate value)(intermediate value)(intermediate value)' as it is undefined.",
"stack": [
{
"name": "Http2SecureServer.app",
"file": "/home/milk-user/lib/lactoserv/lib/node_modules/http2-express-bridge/lib/bridge.js",
"line": 52,
"col": 9
},
{
"name": "Http2SecureServer.emit",
"file": "node:events",
"line": 537,
"col": 28
},
{
"name": "Http2SecureServer.onServerStream",
"file": "node:internal/http2/compat",
"line": 883,
"col": 10
},
...
(The original error stack was serialized/deserialized.)
The cited line corresponds to this in the original (unprocessed) source, in bridge.js:
const app = function(req, res, next) {
const { socket } = req.httpVersion === '2.0' ?
req.stream.session : req;
//Checking alpnProtocol for http2
app.handle(req, res, next);
};
Somewhat curiously, it looks like that socket value isn't even used, so maybe there's no point to the line at all?
Anyway, hope this helps.
Bump. Is there any progress on this issue?
Pretty sure this project is abandoned by its owner at this point.
FWIW I ended up dropping this project from my dependencies in favor of writing my own adapter… and then ultimately I dropped Express entirely.