Michael Solomon

Results 172 comments of Michael Solomon

@Torniojaws Does this issue persist? From the stack trace you provided, it seems like another library overrides the `get` or `request` (or the `http` module itself) before Nock does.

Can you please create a repo that reproduces the problem?

stale. Nock tests run in GitHub Actions, so without further information, we can't help. Feel free to reopen with reproduction.

This is interesting. I didn't know about the `flushHeaders` function either, so I'm unfamiliar with its usage patterns. From what I see, [Nock runs the interceptors logic](https://github.com/nock/nock/blob/feaa66fa64d24f95937ef759cdd5a7ca07646f1c/lib/intercepted_request_router.js#L221), and don't wait...

```js const req = http.request('http://httpstat.us/200') const emitSpy = sinon.spy(req, 'emit') req.setHeader('my-header', 'tes') req.flushHeaders() req.on('response', res => { const emitSpyRes = sinon.spy(res, 'emit') res.on('data', () => {}) res.on('end', () => {...

@sambauers It's working for me for `pnpm`, but not for `npm`. Seems like the symlink for `npm` is incorrect. I'm not sure if this bug is from `fnm` or `corepack`...

Ok. It seems like this is from `corepack` side: https://github.com/nodejs/corepack/issues/138 I'm wondering if we need to add `--corepack-enabled-all` option WDYT?

@sambauers it supports `npm|. Just not by default. You need to run `corepack enable --all`

@Schniz WDYT about this? Another option is to add an install hook

I investigated it further. It seems like we don't emit a `readable` event. The [`for await (const chunk of stream)` ](https://github.com/sindresorhus/got/blob/v11.8.6/source/core/utils/get-buffer.ts#L9) in `got` waits for a `readable` event, which is...