-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
misc: drop node 16 support #15290
misc: drop node 16 support #15290
Conversation
@@ -82,7 +82,7 @@ async function runBundledLighthouse(url, config, testRunnerOptions) { | |||
const logLevel = testRunnerOptions.isDebug ? 'verbose' : 'info'; | |||
|
|||
// Puppeteer is not included in the bundle, we must create the page here. | |||
const browser = await puppeteer.connect({browserURL: `http://localhost:${port}`}); | |||
const browser = await puppeteer.connect({browserURL: `http://127.0.0.1:${port}`}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node http/fetch no longer autoresolves localhost to the ipv4 address nodejs/node#40702
I guess it does in Node 20 though so this is only an issue for Node 18
@@ -424,7 +424,7 @@ describe('.resolveGathererToDefn', () => { | |||
it('throws but not for missing gatherer when it has a node dependency error', async () => { | |||
const resultPromise = | |||
resolveGathererToDefn('../fixtures/invalid-gatherers/require-error.js', [], moduleDir); | |||
await expect(resultPromise).rejects.toThrow(/Cannot find module/); | |||
await expect(resultPromise).rejects.toThrow(/no such file or directory/); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "Cannot find module" text came from an error constructed by quibble. Updates in v0.7.0 of quibble appear to surface the actual node error instead. Good change IMO.
'Content-Security-Policy': `default-src 'none';`, | ||
}); | ||
response.statusCode = 200; | ||
response.setHeader('Content-Security-Policy', `default-src 'none';`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm can't find any info in the docs, but for some reason response.writeHead
will end the response in Node 20 and send it to the user. We want to be able to amend the headers and status code later in execution (e.g. if there was a redirect) so we should use setHeader
and statusCode =
now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package.json
Outdated
@@ -10,7 +10,7 @@ | |||
"smokehouse": "./cli/test/smokehouse/frontends/smokehouse-bin.js" | |||
}, | |||
"engines": { | |||
"node": ">=16.16" | |||
"node": ">=18" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try on 18.0.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I got some failures locally on 18.0.0 so I'll add a minor version
Node 16 is reaching EOL on 9/11/23
nodejs/release#release-schedule
nodejs.org/en/blog/announcements/nodejs16-eol