Closed bennypowers closed 6 years ago
is this on Windows? Are you running ws
with any config, if so can you send me the content of your lws.config.js
file?
i can't reproduce this, could you send me a failing test case? I've got a feeling this is a node bug, are you using node v9.4 or higher? socket
should never be undefined
in the clientError
event handler.
I've got a consistent repro (Mac) with http://github.com/bennypowers/mws-restaurant-stage-1.git
git clone git@github.com:bennypowers/mws-restaurant-stage-1.git
npm i
npx bower i
npm start
run lighthouse in chrome audits panel.
Crashes afaict after "StartUrl" but I haven't found a more detailed crash log.
node -v v8.4.0
After changing server: 'http2'
to server: 'lws-http2'
in your config file I am able to reproduce this, looking into it now.
The error you saw (below) made sense as the browser had cancelled the request (ECONNRESET
), killing the socket.
socket.end('HTTP/1.1 400 Bad Request\r\n\r\n')
^
TypeError: Cannot read property 'end' of undefined
Fixed in lws v1.1.9 by testing the socket
exists before writing to it. Please re-install local-web-server. Your lighthouse audit should run now.
just released lws v2.5.0 which now has the --http2
option for native HTTP2 support. See here. Let me know if you find any issues, thanks.
so, your config would change from server: 'lws-http2'
to http2: true
This is really fantastic. THANK you for putting this together.
I noticed that when running npx ws
with the following config, I do not get https, only http.
module.exports = {
stack: [
'lws-body-parser',
'lws-request-monitor',
'lws-log',
'lws-compress',
'lws-mock-response',
'lws-static',
'lws-cors',
],
http2: true,
mocks: 'restaurant-mocks.js',
logFormat: 'stats',
};
have you updated your local dependencies? you've still got the old version installed, locally...
On 6 Mar 2018 17:29, "Benny Powers" notifications@github.com wrote:
This is really fantastic. THANK you for putting this together.
I noticed that when running npx ws with the following config, I do not get https, only http.
module.exports = { stack: [ 'lws-body-parser', 'lws-request-monitor', 'lws-log', 'lws-compress', 'lws-mock-response', 'lws-static', 'lws-cors', ], http2: true, mocks: 'restaurant-mocks.js', logFormat: 'stats', };
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/lwsjs/local-web-server/issues/88#issuecomment-370861384, or mute the thread https://github.com/notifications/unsubscribe-auth/ABMK7KRUoM8NElIPwUQUeC6ZNnfZQaOiks5tbsdzgaJpZM4SbfpF .
ok with the following package.json and the same config as above, I was off to the races. Thanks again!
{
"name": "mws-restaurant-stage-1",
"version": "1.0.0",
"description": "Project files for MWS Nanodegree",
"main": "index.html",
"dependencies": {
"express": "^4.16.2",
"local-web-server": "^2.5.0",
"lws-compress": "^0.2.1",
"lws-http2": "^0.2.2",
"node": "^8.9.4"
},
"devDependencies": {
"bower": "^1.8.2",
"eslint": "^4.18.2",
"eslint-config-recommended": "^2.0.0",
"eslint-plugin-html": "^4.0.1",
"eslint-plugin-no-loops": "^0.3.0",
"htmlhint": "^0.9.13",
"stylelint": "^8.4.0"
},
"scripts": {
"start": "npx ws & node server",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git@github.com:bennypowers:mws-restaurant-stage-1.git"
},
"author": "Benny Powers",
"license": "ISC"
}
Do you have a donate link or a buy-me-a-beer button?
When running lighthouse audits on my page served with lws, I consistently get server crashes a few minutes in to the audit
A little logging on that line (
if (!socket) console.log(error)
) shows that this was the error which precipitated the crashFWIW here's the crash log from lighthouse
Initial URL: https://127.0.0.1/ Chrome Version: 64.0.3282.186 Error Message: Unable to load page: no document request found Stack Trace: