question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

14reactions
eddiemongecommented, Aug 6, 2020

So crazy story. Do npm install and then try starting it again. To me, that seems like a bug in Yarn2

6reactions
pmmmwhcommented, Sep 6, 2020

Bump - I think I’ll proceed on making a PR to push further discussions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module not found error using Yarn 2 to link React components
However, when I run the React app using yarn start I get the following error: ./src/App.tsx Module not found: Your application tried to...
Read more >
Troubleshooting | Yarn
Cannot find module <require-path>. This error message is not generated by Plug'n'Play. Ever. If you get it, it very likely means that your...
Read more >
yarn install peer dependencies automatically - You.com
When you code is running, you will get a bizarre error that function was not found or undefined. This is the problem that...
Read more >
Yarn 3.0 - Hacker News
I used to use yarn all the time until I tried pnpm. ... NPM has not caught up with Yarn 2, but Yarn...
Read more >
[FIXED] Yarn error on bench update - ERPNext Forum
Hi there, getting an error on bench update in production (CentOS 7): $ sudo bench update npm WARN deprecated yarn@1.3.2: It is recommended ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found