Skip to content

MiniOxygen dev: Cannot perform I/O on behalf of a different request (SpanParent) #3789

Description

@RenanPaixao

What is the location of your example repository?

No response

Which package or tool is having this issue?

Hydrogen

What version of that package or tool are you using?

@shopify/cli 3.92.x; @shopify/hydrogen 2026.1.1; @shopify/mini-oxygen 4.0.1 (after updating the packages, the errors were still happening)

What version of React Router 7 are you using?

7.12.0

Steps to Reproduce

Unfortunalely, I do not have an isolated reproduction to share. The errors surface reliably in our production storefront codebase but I was not able to extract a minimal Hydrogen skeleton that triggers them in the same way.

Expected Behavior

Dev server running without unexpected errors or getting stuck

Actual Behavior

The dev server logs multiple distinct stack traces of Cannot perform I/O on behalf of a different request (I/O type: SpanParent) and [Error: Promise will never complete.], often followed by [Error: The script will never generate a response.]. Most requests still return 200, but a noticeable percentage hang.

Sample 1:

Error: Cannot perform I/O on behalf of a different request. I/O objects (such as streams,
request/response bodies, and others) created in the context of one request handler cannot
be accessed from a different request's handler. (I/O type: SpanParent)
  at Object.invoke (@shopify/mini-oxygen/dist/vite/worker-entry.js:1382:22)
  at Object.invoke (@shopify/mini-oxygen/dist/vite/worker-entry.js:584:40)
  at Object.invoke (@shopify/mini-oxygen/dist/vite/worker-entry.js:707:34)
  at ModuleRunner.getModuleInformation (@shopify/mini-oxygen/dist/vite/worker-entry.js:1202:94)
  at ModuleRunner.cachedModule (@shopify/mini-oxygen/dist/vite/worker-entry.js:1188:21)
  at request (@shopify/mini-oxygen/dist/vite/worker-entry.js:1224:99)
  at /apps/storefront/app/root.tsx:1:1
  at Object.runInlinedModule (@shopify/mini-oxygen/dist/vite/worker-entry.js:1418:11)
  at ModuleRunner.directRequest (@shopify/mini-oxygen/dist/vite/worker-entry.js:1281:61)
  at ModuleRunner.cachedRequest (@shopify/mini-oxygen/dist/vite/worker-entry.js:1177:79)

Sample 2:

Volume discounts API error: Error: Cannot perform I/O on behalf of a different request.
(I/O type: SpanParent)
  at Object.getItem [as get] (@shopify/hydrogen/dist/.../runWithCache:4345:32)
  at getItemFromCache (@shopify/hydrogen/dist/.../runWithCache:4409:35)
  at runWithCache (@shopify/hydrogen/dist/.../runWithCache:4518:28)
  at Object.run (@shopify/hydrogen/dist/.../runWithCache:4663:14)
  at action (app/routes/($locale).api.volume-discounts.tsx:32:26)
  ...

Sample 3:

Error: Cannot perform I/O on behalf of a different request. (I/O type: SpanParent)
  at Object.forward (@shopify/hydrogen/dist/.../forward:5280:37)
  at @shopify/hydrogen/dist/oxygen/index.js:75:44
  ...

Often accompanied by:

[Error: Promise will never complete.]
[Error: The script will never generate a response.]
A hanging Promise was canceled.

Same code paths execute cleanly in production Oxygen (no errors) and via shopify hydrogen preview --build ).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions