-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Missing preset triggered invalid preset config error #5006
Comments
That's weird.. I just did that without installing the presets and got |
Hi i am getting the same error although i have the preset module installed i am still stuck. webpack.config module.exports = { .babelrc { |
@Kushan- What is in your |
The error is saying your |
okay, i found it.. Sorry this is my first time setup.. thank you so much |
I couldn't reproduce this error either. @KyleAMathews Could you maybe walk us through the steps that you took to get to this error? |
I did in the original post... it was just a simple jsx => js file conversion. If no one can reproduce it we can close this. |
Sorry, looks like I never properly replied to this. @aaronang happy to chat more, but essentially this is because of the way we look of presets both with and without the It might be worth us considering if there's a way we can generate a single name in all cases, rather than generating multiple possibilities and then trying each one. See https://github.com/babel/babel/blob/d0b6db19011c5c4e84558bb21bcfc2a948f63a82/packages/babel-core/src/config/helpers/get-possible-preset-names.js and https://github.com/babel/babel/blob/d0b6db19011c5c4e84558bb21bcfc2a948f63a82/packages/babel-core/src/config/helpers/get-possible-plugin-names.js Like we could do For instance We have options, but it's not obvious what the right call would be. |
@loganfsmyth Thanks for the explanation. I can now confirm this error. It indeed occurs when |
I posted a PR with a proposed approach: #5547 |
Closing via #5547 |
This will now throw a much more useful error "Cannot find module 'babel-preset-react'` in 7.x |
Thanks everyone! |
I am getting the same error, thanks for @loganfsmyth~ |
It workswithout .babelrc I could be resolved adding |
I was setting up a project with a .babelrc that looked like:
and when trying to transpile my code kept getting an error like:
After googling around quite confused (my .babelrc is a vanilla as it gets) it finally occurred to me that perhaps one of the presets wasn't installed which as turned out to be the problem. Once babel-presets-react was installed things worked.
Expected Behavior
Babel tells me there's missing presets/plugins.
Current Behavior
Babel identifies the wrong problem.
Environment
Mac, Node 6, NPM 3
The text was updated successfully, but these errors were encountered: