-
-
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
Don't crash if users mistakingly install babel, webpack, jest, loaders, etc, at the top level #1795
Comments
@anyayunli If you’d like control over configs, run |
This is about inexperienced developers. It can be limited only by more educational examples and strict rules for opening issues. |
And more visible dedicated site for users, stack overflow is not enough |
Is there anything wrong with us showing a nasty-looking warning when people do this? |
No, really not. You are experiencing success, you only need way to fastly redirect people from Github to more general discussion about when they should eject! |
Optimally, we want people not to eject. I feel like there's way too many small things people eject for that's accomplishable without ejecting (e.g. using |
So, this can be statistically observed. You can inject some questionary into eject command with helpful links. This is task for @cpojer like person:-) |
@gaearon what about something like this? |
Nice, but not enough. It will works BUT you are not providing hint. When you run eject, it should ask you why you need eject providing most relevant information. No way back after. That's ok, but warn about they are not supported by this awesome toolkit any more.. |
I’d like us to first look into why this breaks CRA. If there's a version conflict, |
Different idea. Can you hook yarn with CRA? For example as preinstall, pre-add in package.json. I know, this is something new! But this is in your possibilities! |
We already use Yarn when it’s installed. It doesn’t solve the problem though. |
Yarn hook which will dog watching what you want add |
It's entire new space not possible today. Yes you can give recommendations only..: |
Where this recommendations can be stored? In package.json at first, at remote server specified in package, at hashtag on Twitter.. irc is almost dead but why not.. So first class will be custom scripts. In future this will be there.. |
Is there any repo that easily reproduces this issue? I'd like to give it a look... |
No idea, but if you can create one that would be great. My impression is you need to create a project and then install |
Here is an example, updating |
Any solution to this would require CRA to work around how the package manager works, which in my opinion is not the right thing. A package should not override the package manager rules. I am okay with a mechanism that detects wrong versions of the packages and warn, or at worst, just give up. |
experimented using pkg to package react-scripts as an executable: https://github.com/viankakrisna/react-scripts-packaged/releases/tag/0.0.1 |
I personally think Jest should be excluded from this list. Using testing through CRA is optional. I'd like to use CRA for all the tooling to setup and run and app, but do testing myself (I like to interact with jest directly). Maybe the create-react-app script to run tests could do this check, so you would only fail if you locally had jest installed and tried to run tests through CRA. Maybe that's how it's intended to work and I missed that point. :) If so, that sounds great. |
I think we keep talking past each other. Sorry if I'm being confusing. I don't propose to forbid using your own version. (Early wording says that but my more recent comments don't.) What I'm saying is we should make sure that installing arbitrary Jest/Babel/Whatever version at top level does not break any of built-in Does this clarify things? That's the only problem I'm referring to in this issue. |
I may have missed a reply, especially since there were two threads that got merged. Sounds great. Sorry if I didn't read the original description well enough. |
I did some debugging. The Jest issue is caused by how Jest packages communicate: jestjs/jest#5294. |
For Webpack, this happens (at least with npm) because:
I don't know why |
I chatted to npm folks about #1795 (comment) — it is a known npm issue. Yarn doesn't have it. They tried to fix it in 5.x but that created other issues so they're holding off until future majors. |
Fixed by #3771. There is a way to opt out of the preflight check for those who know what they're doing (it's mentioned at the end of the displayed message). |
I’ve seen this issue multiple times. For some reason people don’t believe
react-scripts
is enough and try to install Babel, Webpack, and friends themselves. This can break things.We need to mitigate this somehow.
The text was updated successfully, but these errors were encountered: