-
-
Notifications
You must be signed in to change notification settings - Fork 754
Closed
Description
Please avoid duplicates
- I checked all open bugs and none of them matched my problem.
Reproducible test case
example below
Nock Version
14.0.1
Node Version
20.18.1
TypeScript Version
No response
What happened?
repro
- Save this to
script.js:
const { back: nockBack } = require("nock");
const path = require("path");
(async () => {
nockBack.fixtures = "tests/fixtures";
const { nockDone } = await nockBack(`good_request.json`);
await fetch("https://api.descript.com", { method: "POST", body: "" });
nockDone();
})();-
install nock:
npm install [email protected] -
and run
NOCK_BACK_MODE=update node script.js:
% NOCK_BACK_MODE=update node script.js
node:internal/deps/undici/undici:9856
throw new TypeError("unusable");
^
TypeError: unusable
at Request.clone (node:internal/deps/undici/undici:9856:17)
at recordResponse (/Users/marcello/github/nock-back-bug/node_modules/nock/lib/recorder.js:260:32)
at _Emitter.<anonymous> (/Users/marcello/github/nock-back-bug/node_modules/nock/lib/recorder.js:255:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async emitAsync (/Users/marcello/github/nock-back-bug/node_modules/@mswjs/interceptors/lib/node/chunk-6L3PFBGT.js:68:5)
at async /Users/marcello/github/nock-back-bug/node_modules/@mswjs/interceptors/lib/node/chunk-LEA3MUU3.js:277:11
at async /Users/marcello/github/nock-back-bug/script.js:7:3
Node.js v20.18.1Note: this does not repro on 14.0.0
Would you be interested in contributing a fix?
- yes
Reactions are currently unavailable