Closed andrisi closed 3 years ago
Can you try the main
branch instead? 11.8.2
still uses an old version of http2-wrapper
I have http2-wrapper 2.0 in the project too as I initially tried with that as an agent, but then saw it fails without that in the request too. If that is not enough, I'd try later.
Got the same error. Upgrading to Node v15.12.0 and changing the package.json fixed it:
"got": "sindresorhus/got#main",
Got the same error. Upgrading to Node v15.12.0 and changing the package.json fixed it:
"got": "sindresorhus/got#main",
i think we need to build before use How to build that ?
Error: Cannot find module '/****/node_modules/got/dist/source'. Please verify that the package.json has a valid "main" entry
How to build that ?
npm run build
Many thanks Can you tell me why I can't install by yarn I need to use 'npm install' instead, with that I can see dist folder built It just clone repo when use "yarn install"
Can you tell me why I can't install by yarn
I have no idea, probably something related to your environment.
this is still an issue with node 15.12
`Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals. Please open an issue with this stack trace at https://github.com/nodejs/node/issues
at new NodeError (node:internal/errors:329:5)
at assert (node:internal/assert:14:11)
at ClientRequest.Writable.destroy (node:internal/streams/writable:851:5)
at Request._destroy (C:\Develop\mastercompare\node_modules\got\dist\source\core\index.js:1368:32)
at _destroy (node:internal/streams/destroy:67:23)
at Request.destroy (node:internal/streams/destroy:59:5)
at Request._error (C:\Develop\mastercompare\node_modules\got\dist\source\core\index.js:1190:14)
at C:\Develop\mastercompare\node_modules\got\dist\source\core\index.js:1270:23 {
code: 'ERR_INTERNAL_ASSERTION' }`
@andrisi I've just tested with http2-wrapper@2.0.0
and I'm getting a different error:
const http2 = require('http2-wrapper');
const got = require('got');
try {
await got('https://http2.pro/api/v1', {
http2: true,
responseType: 'json',
request: http2.auto,
headers: {
connection: "keep-alive"
}
});
} catch (error) {
console.error(error.stack);
}
Error [ERR_STREAM_DESTROYED]: Cannot call end after a stream was destroyed
at new NodeError (node:internal/errors:329:5)
at errorBuffer (node:internal/streams/writable:527:14)
at processTicksAndRejections (node:internal/process/task_queues:80:21)
this is still an issue with node 15.12
Make sure you have the correct version in node_modules/got/package.json
and the same with http2-wrapper.
Fixed: https://github.com/szmarczak/http2-wrapper/commit/93f36ef298706a950ae65be08fb57df241a75655
Will publish a new version of http2-wrapper
later today.
Thanks @szmarczak ! Will you update got too, it seems to use an internal version of http2-wrapper.
Describe the bug
Adding a connection: "keep-alive" header in http2 mode causes ERR_INTERNAL_ASSERTION
Actual behavior
ERR_INTERNAL_ASSERTION
Expected behavior
Perhaps ignore silently or warn that it is inapropriate?
Code to reproduce
Checklist