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

First parameter has member 'readable' that is not a ReadableStream (with @vercel/blob) #7614

Open
1 task done
jorisre opened this issue Oct 9, 2023 · 2 comments
Open
1 task done
Labels
bug:unverified feat:fetch Issues related to @remix-run/web-fetch

Comments

@jorisre
Copy link

jorisre commented Oct 9, 2023

What version of Remix are you using?

2 and 1.19

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

  1. Start a new project using Remix
  2. Add @vercel/blob package
  3. Call the list function of @vercel/blob from a Remix loader
  4. 💥 Error happen:

throw new TypeError(${context} is not a ReadableStream.);
^
TypeError: First parameter has member 'readable' that is not a ReadableStream.

This CodeSandbox shows the error, does anyone know a workaround?

https://codesandbox.io/p/sandbox/sparkling-flower-hmrkj4

Expected Behavior

Should not throw an error and return the blobs

Actual Behavior

It throws the following error:

info building...
info built (537ms)
[remix-serve] http://localhost:3000 (http://192.168.1.102:3000)

/Users/joris/w/blob/node_modules/web-streams-polyfill/src/lib/validators/readable-stream.ts:5
throw new TypeError(${context} is not a ReadableStream.);
^
TypeError: First parameter has member 'readable' that is not a ReadableStream.
at assertReadableStream (/Users/joris/w/blob/node_modules/web-streams-polyfill/src/lib/validators/readable-stream.ts:5:11)
at convertReadableWritablePair (/Users/joris/w/blob/node_modules/web-streams-polyfill/src/lib/validators/readable-writable-pair.ts:15:3)
at ReadableStream.pipeThrough (/Users/joris/w/blob/node_modules/web-streams-polyfill/src/lib/readable-stream.ts:211:23)
at fetchFinale (/Users/joris/w/blob/node_modules/undici/lib/fetch/index.js:973:52)
at mainFetch (/Users/joris/w/blob/node_modules/undici/lib/fetch/index.js:773:5)
at processTicksAndRejections (node:internal/process/task_queues:95:5)

@jorisre jorisre changed the title First parameter has member 'readable' that is not a ReadableStream First parameter has member 'readable' that is not a ReadableStream (with @vercel/blob) Oct 9, 2023
@brophdawg11 brophdawg11 added the feat:fetch Issues related to @remix-run/web-fetch label Oct 31, 2023
@nakleiderer
Copy link

I ran into this issue as well when enqueuing a job with BullMQ. Since this was occurring in the Node-side of my application (I'm running a custom server), I removed the installGlobals() call. After this, my BullMQ jobs enqueued successfully.

  System:
    OS: macOS 14.1.2
    CPU: (10) arm64 Apple M1 Max
    Memory: 3.77 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.10.0 - ~/.asdf/installs/nodejs/20.10.0/bin/node
    npm: 10.2.3 - ~/.asdf/plugins/nodejs/shims/npm
  npmPackages:
    @remix-run/dev: ^2.3.1 => 2.3.1 
    @remix-run/eslint-config: ^2.3.1 => 2.3.1 
    @remix-run/express: ^2.3.1 => 2.3.1 
    @remix-run/node: ^2.3.1 => 2.3.1 
    @remix-run/react: ^2.3.1 => 2.3.1 
    bullmq: ^4.15.0 => 4.15.0 
module.exports = {
  appDirectory: "src",
  cacheDirectory: "./node_modules/.cache/remix",
  ignoredRouteFiles: ["**/.*", "**/*.css", "**/*.test.{js,jsx,ts,tsx}"],
  serverModuleFormat: "esm",
  serverPlatform: "node",
  watchPaths: ["./tailwind.config.cjs"],
};

@maxfi
Copy link

maxfi commented Apr 7, 2024

Possibly related: vercel#62 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:unverified feat:fetch Issues related to @remix-run/web-fetch
Projects
None yet
Development

No branches or pull requests

5 participants