http2-express-bridge icon indicating copy to clipboard operation
http2-express-bridge copied to clipboard

Exception: `Cannot destructure property 'socket' of '(intermediate value)(intermediate value)(intermediate value)' as it is undefined.`

Open danfuzz opened this issue 2 years ago • 2 comments

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.

danfuzz avatar Feb 10 '23 17:02 danfuzz

Bump. Is there any progress on this issue?

victor-homyakov avatar Jul 17 '24 08:07 victor-homyakov

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.

danfuzz avatar Jul 17 '24 18:07 danfuzz