After creating a React app with yarn dlx create-react-app, the first time I press yarn start to start it, I get an error

Viewed 611

Use yarn 2 (yarnpkg/berry)

  • in terminal
% yarn set version berry
% yarn dlx create-react-app apple
% cd apple
% yarn start
  • in browser
Failed to compile
Failed to load config "react-app" to extend from.
Referenced from: D:\Projects\apple\package.json
This error occurred during the build time and cannot be dismissed.

How do I solve this problem?

ps. yarn dlx create-next-app works fine. only have a problem with the CRA

2 Answers

create-react-app currently includes eslint-config-react-app already. So added that led to a conflict

Plugin "react" was conflicted between "package.json » eslint-config-react-app » C:\Users\bhalb\programming\activity-tracker\.yarn\__virtual__\eslint-config-react-app-virtual-8e12459b5a\0\cache\eslint-config-react-app-npm-7.0.0-1ad319c3be-dac130cfcb.zip\node_modules\eslint-config-react-app\base.js" and "BaseConfig » C:\Users\bhalb\programming\activity-tracker\.yarn\__virtual__\eslint-config-react-app-virtual-6f6769fb06\0\cache\eslint-config-react-app-npm-7.0.0-1ad319c3be-dac130cfcb.zip\node_modules\eslint-config-react-app\base.js".

My solution was to disable plug'n'play by setting nodeLinker: node-modules in .yarnrc.yml

Before yarn start adding the step yarn add eslint-create-react-app solved this issue for me

Related