Skip to content

[Bug]: Defer + single resolved promise causes "Deferred data aborted" error in dev tools #9706

Closed
@jklosinski

Description

@jklosinski

What version of React Router are you using?

6.4.0

Steps to Reproduce

I modified the Deferred example app: https://stackblitz.com/edit/github-roj5bp?file=src/routes.tsx

  1. Open sample above
  2. Open dev tools
  3. Click on Deferred 2
  4. Click on Home
  5. In dev tools, you should get a "Deferred data aborted" error even though the object passed to defer contains only a single resolved promise

Is this behavior expected? I can't find any info about it on the web.

Expected Behavior

The object passed to defer has just one resolved value:

export async function deferredLoader2() {
  return defer({
    critical1: await resolve("Critical 1", 250),
  });
}

So I would expect that there should not be any errors around deferred data being aborted.

Actual Behavior

The error is thrown. One thing to note, is that if you click on the Deferred link (which is unmodified from the example app) and let it load, the error does not occur.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions