-
Notifications
You must be signed in to change notification settings - Fork 209
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
TypeError: Found invalid object in transferList #527
Comments
Hey! 👋 Could you post the full stack trace for the error? Are you using any byte streams in your Worker? This is possibly related to nodejs/node#45955, which may be fixed by upgrading to Node 19.7.0. |
I'm not using any bytes streams explicitly, but I am using Here's the stacktrace: TypeError: Found invalid object in transferList
at structuredClone (/project/node_modules/undici/lib/fetch/constants.js:109:19)
at cloneBody (/project/node_modules/undici/lib/fetch/body.js:273:21)
at cloneResponse (/project/node_modules/undici/lib/fetch/response.js:318:24)
at Response.clone (/project/node_modules/undici/lib/fetch/response.js:258:28)
at Response.clone (/project/node_modules/@miniflare/core/src/standards/http.ts:647:38)
at equal (test/handle.test.ts:242:35)
at Context.<anonymous> (test/handle.test.ts:217:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5) |
Currently running on node16, running on node19 produces the same result for me. The code I'm trying to run: const actualText = await actual.clone().text()
const expectedText = await expected.clone().text() Which will result in the aforementioned error If I manually clone (or recreate?), it seems to work. const actualResponseClone = new Response(undefined, actual)
const expectedResponseClone = new Response(undefined, expected) |
Hi! the same happens to me when running tests that involves cloning the response using
Current setup:
|
I'm getting this issue as well with code very similar to what @albertinad has. I did confirm though that upgrading to Node 19.7.0 solved the issue that @mrbbot linked to |
This applies the same fix for `Request` bodies from #510 to `Response`s. Notably, byte streams are returned from lots of Workers runtime APIs (e.g. KV, R2) to support BYOB reads. It's likely these are then used in `Response`s and cloned for caching.
This applies the same fix for `Request` bodies from #510 to `Response`s. Notably, byte streams are returned from lots of Workers runtime APIs (e.g. KV, R2) to support BYOB reads. It's likely these are then used in `Response`s and cloned for caching.
When attempting to run tests using minflare, for some reason I got
TypeError: Found invalid object in transferList
whilst attempting to clone a response. Not sure why that happens, and suspect that might be a bug, Can someone point me to the correct direction on this?The text was updated successfully, but these errors were encountered: