Skip to content

4.0.0-next.77 sample app yields "Module not found: Your application tried to access react-refresh" when started with Yarn 2 #9446

Closed
@volodymyr-kushnir

Description

@volodymyr-kushnir

Describe the bug

create-react-app@4.0.0-next.77 yields "Module not found: Your application tried to access react-refresh, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound." after running yarn start with Yarn 2. Installing react-refresh as dependency solves the problem, tho.

Environment

Environment Info:

  current version of create-react-app: 4.0.0-next.77
  running from /Users/v.kushnir/.npm/_npx/57508/lib/node_modules/create-react-app

  System:
    OS: macOS 10.15.6
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 12.16.3 - /usr/local/bin/node
    Yarn: 2.1.1 - /usr/local/bin/yarn
    npm: 6.14.4 - /usr/local/bin/npm
  Browsers:
    Chrome: 84.0.4147.105
    Edge: Not Found
    Firefox: Not Found
    Safari: 13.1.2
  npmPackages:
    react: Not Found
    react-dom: Not Found
    react-scripts: Not Found
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

  1. npx create-react-app@next --scripts-version=@next --template=cra-template@next my-js-app
  2. cd my-js-app
  3. yarn set version berry
  4. yarn set version latest
  5. yarn install
  6. yarn start

Expected behavior

App is served without problems.

Actual behavior

App throws an error.
image

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