Skip to content

CRA test environment no longer compatible with version 6.4.5 of react-router #12913

@hovsater

Description

@hovsater

Describe the bug

For a detailed explanation of the problem, see remix-run/react-router#9722 (comment), which is the issue I originally opened.

CRA automatically injects fetch in the Jest test environment. Since fetch isn't spec-compliant (it does not expose a body property) it fail the check introduced by react-router, version 6.4.5, thus making react-router misbehave.

A suggestion was made by @brophdawg11 to use @remix-run/web-fetch instead, but this isn't necessarily easy to implement as there's no exposed entrypoints in CRA to inject the polyfill before fetch gets injected.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions