-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
CRA dev dependency warning with yarn workspaces with react-scripts@2.0.0 #4296
Comments
I did a clean repro today. |
This is very similar to #4167 (only difference is that I'm using a workspace). |
there were a bunch of configuration issues when I tried to configure various projects. So at the end of the day I feel this warning is justified.
|
Just encountered this problem.
I want my cra app to transpile an imported package in a monorepo. |
Note that as the warning says at the very bottom, there's a way to disable it if you know what you're doing. We added a warning because way too many users either hit npm bugs or shoot themselves in the foot by hoisting incorrect versions or installing them manually into CRA projects. |
@trompx I was able to get CRA to transpile code from another yarn workspace in the monorepro with no problems (cra 2.0 of course). I don't fully understand the mechanics here, but have no problems so far and really happy with the final result. |
@bugzpodder @gaearon Hey, thanks for the feedback. The key for me to make it work for non CRA apps was:
One problem remains and I have a really hard time to figure it out. Would you consider the possibility to set a VERBOSE/DEBUG env variable that would set dev server stats to verbose? |
Instead of module.resolves, I was using the nodeExternals:
Because my non-CRA app is server side. It compiles instantly because it doesn't actually include the node-modules js in the bundled code. For client side (CRA) apps, it includes all your dependencies I believe. |
@Timer Can you expand on why this issue is closed? I'm still seeing it. We have a monorepo holding multiple CRA v1 apps and would prefer to not have to upgrade them all at once, but we're seeing issues with a CRA v2 app exiting after warning about babel-jest being "detected higher up in the tree". |
Is this a bug report?
YES
Did you try recovering your dependencies?
YES
yarn 1.5.1
Which terms did you search for in User Guide?
Environment
node -v
: 8.9.3npm -v
:yarn --version
(if you use Yarn): 1.5.1npm ls react-scripts
(if you haven’t ejected): 2.0.0-next.b2fd8db8Then, specify:
Steps to Reproduce
(Write your steps here:)
Create app1 (express) with devdependencies:
"devDependencies": {
"babel-jest": "22.4.3",
"eslint": "4.19.1",
"jest": "22.4.3"
},
Create app2 (CRA)
Expected Behavior
yarn start succeeds
Actual Behavior
There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.
The react-scripts package provided by Create React App requires a dependency:
"jest": "22.1.2"
Don't try to install it manually: your package manager does it automatically.
However, a different version of jest was detected higher up in the tree:
root/node_modules/jest (version: 22.4.3)
Reproducible Demo
The text was updated successfully, but these errors were encountered: