New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dependency Warning - proper way to implement Yarn Workspace monorepo with CRA with root dependencies? #6324
Comments
Try the nohoist option, maybe this will get you started: |
@bugzpodder Thanks for the response. Just wondering, are you adding this to the root of your repo? My concern with adding nohoist is that then my projects won't be able to see my linting rules at the root, and then I'd have to manually install all the dev dependencies for linting to each project. I'll give this a shot today but I'm hoping that won't be the case. |
Yes I'm adding this to the root. It simply installs packages in their respective directories rather than hoisting, so it should not have noticable impact in your build process. |
@bugzpodder https://github.com/clayhan/cra-yarn-test Super appreciative of your time. |
I would do one of two things:
|
@bugzpodder Still no dice on any sort of implementation. It seems CRA keeps defaulting to whatever is in the root node_modules and refuses to run. I'm hesitant to skip the check since this application I'm wanting to build is going to be something we keep for several years. Thinking since this seems to be a huge problem with CRA that I'm going to just skip it entirely. I tried replicating the 2nd option you gave me, but it still kept giving me the same issues. Do you possibly have a demo repo where you were able to accomplish option 2? Thanks a ton. |
I don't have a public repo, but if you follow these instructions it should just work:
|
Just FYI, "workspaces": {
"packages": ["packages/*"],
"nohoist": ["**/babel-eslint", "**/babel-eslint/**"]
} |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
I am running into an issue when trying to start CRA when I have similar dependencies in the root of my yarn workspace monorepo. I have a .eslintrc in the root of my project along with all of my Eslint/Prettier packages so that all of my projects are able to receive linting/autoformatting.
I just recently added CRA to my monorepo in an attempt to create a new application. This gives me an error message and I did not want to assume that I would not run into any future issues. I am hoping to learn the ideal solution to how to properly use CRA within a yarn workspace monorepo while also being able to have proper linting/autofortmatting via Eslint and Prettier.
Demo repo below.
Is this a bug report?
Maybe
Very closely related to #4296. I was unable to decipher a proper solution from this discussion.
Steps to Reproduce
yarn
to install dependenciesyarn workspace my-app start
to try to start the application.Expected Behavior
yarn start succeeds
Actual Behavior
Get error message:
Reproducible Demo
https://github.com/clayhan/cra-yarn-test
Thanks for any help!
The text was updated successfully, but these errors were encountered: