Skip to content

[CRA v5] Jest + React-markdown = Must use import to load ES Module #11946

Open
@nulltoken

Description

@nulltoken

Describe the bug

Running a CRA test rendering react-markdown leads to an error message "Must use import to load ES Module:"

A (somewhat) related issue in remarkjs/react-markdown#635 seems to redirect to https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c, which in turn states "Create React App doesn't yet fully support ESM. I would recommend opening an issue on their repo with the problem you have encountered. One known issue is #10933."

/cc @ChristianMurphy

Did you try recovering your dependencies?

Yes

Which terms did you search for in User Guide?

esm

Environment

Windows

Steps to reproduce

Full repro case is available at

  1. Clone https://github.com/nulltoken/repro-react-markdown-cra-esm
  2. run yarn test

Output of yarn test can be reviewed at https://github.com/nulltoken/repro-react-markdown-cra-esm/runs/4841320780?check_suite_focus=true

Expected behavior

I'd very much like the test not to fail because of an import issue :-/

Actual behavior

image

Reproducible demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

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