Skip to content
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

Runtime TypeError with node-fetch-cache #8487

Open
glensc opened this issue Jan 25, 2024 · 0 comments
Open

Runtime TypeError with node-fetch-cache #8487

glensc opened this issue Jan 25, 2024 · 0 comments
Labels
bug Something isn't working needs investigate Needs to be investigated to find the root cause

Comments

@glensc
Copy link

glensc commented Jan 25, 2024

What version of Bun is running?

1.0.25

What platform is your computer?

Darwin 23.2.0 arm64 arm

What steps can reproduce the bug?

  1. install node-fetch-cache==4.1.0
  2. create NodeFetchCache with FileSystemCache
  3. run fetch

What is the expected behavior?

Program complete normally without exception being thrown.

What do you see instead?

➜ bun run index.ts
400 |     function E(code, message, Base) {
401 |       if (!Base)
402 |         Base = Error;
403 | 
404 |       class NodeError extends Base {
405 |         constructor(...args) {
                                ^
TypeError: The "streamReadable" argument must be an stream.Readable. Received an instance of Pipeline
 code: "ERR_INVALID_ARG_TYPE"

      at new NodeError (node:stream:405:39)
      at newReadableStreamFromStreamReadable (node:stream:2407:83)
      at new Response (node-fetch:48:27)
      at new NFCResponse (/Users/glen/scm/tmp/bun-node-fetch/node_modules/node-fetch-cache/dist/classes/response.js:36:9)
      at /Users/glen/scm/tmp/bun-node-fetch/node_modules/node-fetch-cache/dist/index.js:24:16

Does not crash when compiled to js and run then

bun build index.ts --target=node --outfile build/index.js
➜ bun build/index.js 
NFCResponse {
  [Symbol(Body internals)]: {
...

Additional information

Created reproducer as gist:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs investigate Needs to be investigated to find the root cause
Projects
None yet
Development

No branches or pull requests

2 participants