Crypto-Touchbar-App icon indicating copy to clipboard operation
Crypto-Touchbar-App copied to clipboard

ERR_INVALID_CHAR when browse localhost:8080

Open xLinkOut opened this issue 4 years ago • 1 comments

After npm install and npm start the webserver starts normally

luca Crypto-Touchbar-App (master) > npm start
> [email protected] start
> node node_modules/watch-http-server/bin/http-server
Websocket Server Listening on Port: 8086
Starting up http-server, serving ./ on: http://0.0.0.0:8080

But when browse http://0.0.0.0:8080 the server crash with:

node:_http_outgoing:557
    throw new ERR_INVALID_CHAR('header content', name);
    ^

TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["etag"]
    at ServerResponse.setHeader (node:_http_outgoing:566:3)
    at module.exports.ResponseStream.<computed> [as setHeader] (/Users/luca/Desktop/Crypto-Touchbar-App/node_modules/union/lib/response-stream.js:100:34)
    at serve (/Users/luca/Desktop/Crypto-Touchbar-App/node_modules/sexstatic/lib/sexstatic.js:248:11)
    at /Users/luca/Desktop/Crypto-Touchbar-App/node_modules/sexstatic/lib/sexstatic.js:177:11
    at FSReqCallback.oncomplete (node:fs:200:5) {
  code: 'ERR_INVALID_CHAR'
}

I managed to get it to work commenting line 248 in sexstatic.js

      //res.setHeader('etag', etag(stat));

(node 15.5.1 / npm 7.3.0)

xLinkOut avatar Jan 06 '21 19:01 xLinkOut

Hey @xLinkOut thanks for that, further to my comment here I suspect this is due to the node version. When I get around to any updates I'll check the compatibility with newer node versions - If I recall this was targetting 10.x or 12.x

Thanks once again

chrislennon avatar Jan 07 '21 09:01 chrislennon