Skip to content

Support of es6 module in test #12063

@VikasAgarwal1984

Description

@VikasAgarwal1984

Describe the bug

react-scripts test fails if imported package is esm module only.
Build woks fine and have no issues.
Issue is similar to #5241

Which terms did you search for in User Guide?

https://create-react-app.dev/docs/running-tests

Environment

current version of create-react-app: 5.0.0

System:
OS: Windows 10 10.0.19042
CPU: (8) x64 Intel(R) Core(TM) i7-10610U CPU @ 1.80GHz
Binaries:
Node: 16.13.2 - C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm: 8.1.2 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: Not Found
Edge: Spartan (44.19041.1266.0), Chromium (98.0.1108.50)
Internet Explorer: 11.0.19041.1202
npmPackages:
react: ^17.0.2 => 17.0.2
react-dom: ^17.0.2 => 17.0.2
react-scripts: 5.0.0 => 5.0.0
npmGlobalPackages:
create-react-app: Not Found

Steps to reproduce

(Write your steps here:)

  1. Create a basic package which only produce esm module.
  2. Create a new App with create-react-app.
  3. Import one of the class in App.tsx
  4. Build works fine, Test fails.

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