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
Error: Couldn't find preset "latest" #202
Comments
hi @eatrocks what version of Babel are you running in your project? I haven't been able to reproduce yet. It does seem odd, your project shouldn't be affected by Helmet's babel configuration. |
Hi @cwelch5 thanks for your help. My node version is 6.9.1, npm version is 3.10.8. My babel versions are below, and all are latest according to npmjs.org...
You might be able to reproduce it by using the tuxsudo react-starter with the following steps...
|
@eatrocks I gave it a try, and I do get an error referring to "latest" but it doesn't mention Helmet anywhere. I rolled back Helmet to 3.1.0 and I get the same error. I think you're error (based on the steps you provided) is caused by your babelrc referring to "latest", but you are swapping your package.json to use es2015 instead. |
@cwelch5 I apologize, I left that out of the reproduction steps. You are correct, |
@terrysahaidak I see your fix/commit. Thanks! Do you know if it is expected behavior of |
@eatrocks yes, it's a normal behavior. My current workaround is to install babel-preset-latest. But it's strange, because in my second project with the same babel and react-helmet versions and etc everything works great without any errors. |
@terrysahaidak in the last minor release we moved babel configuration from .babelrc to package.json. It seems as if moving babel configuration back to .babelrc will fix the issue, would you agree? |
@eatrocks it would be a solution :) |
It is strange as the published version The babel latest preset has the 2015 preset in it. Babel site recommends you use the latest preset to stay update. @eatrocks It would be a good idea to lockdown your npm dependencies versions in from "react-helmet": "^3.0.1", to
As anyone using it could potential run into different issues based on when they happen to do the npm install and one of your npm dependency does a release that breaks something :(. |
@andykenward I believe @eatrocks 's issue is that the babel configuration in Helmet's package.json is affecting his babel transpilation. And according to @terrysahaidak it's expected for their to be a conflict when you move babel configuration to package.json. What's your take? |
@cwelch5 @eatrocks I just looked into tuxsudo/react-starter repo more and it is a webpack issue. The webpack babel-loader isnt ignoring the See lines 22 -23 in webpack.base.babel.js @eatrocks & @terrysahaidak
I recommend you change the babel-loader config in your repo to this
You dont need to test for jsx as you are using js files in your repo. Also you might as well call all your loaders by the full name as in the webpack 2 they have stopped adding on the If you read the readme of the Also check the troubleshooting section of babel-loader. It just happens to error out on @cwelch5 So you can close this issue |
Thanks @andykenward for investigating. That clears things up. @eatrocks - give that a try and let us know if that resolves things. Thanks. |
Thanks @andykenward and @cwelch5 - I appreciate your detailed look into our project and your suggestions, especially adding "-loader", using "latest", and targeting just ".js". We are working on the best way to exclude You already have committed to master a fix that pulls the babel config out of your |
@eatrocks you should research into compiling es6 npm modules.
Check out how I also suggest you switch to webpack 2 for its tree shaking feature. Will do a pull request to move babel config to |
I'm not sure if this is the correct place to post this issue however... I'm using
react-helmet
in my project which I build withwebpack
andbabel.js
. When I build I getERROR in ./~/react-helmet/lib/Helmet.js Module build failed: Error: Couldn't find preset "latest" relative to directory /path/to/my/project/node_modules/react-helmet
.I believe this started because of version
af13c9c
ofpackage.json
where thereact-helmet
babel config was moved into it'spackage.json
.The error indicates that the
latest
babel.js preset was not found, which thebabel
config withinreact-helmet
is calling for. Therefore the error will only show up for projects that are not already using thelatest
babel
preset.I have verified that my project uses the built version of
Helmet.js
found in./node_modules/react-helmet/lib
. What baffles me is whyBabel
is reading config from thereact-helmet
package.json
. I understandnode.js
needs to read themain
property to know where to find the code, but since that code is already transpiled I don't know whybabel
would need to read config from there.I'm using
react-helmet@3.2.2
.Workarounds include
react-helmet
package.json
react-helmet@3.1.0
or belowThe text was updated successfully, but these errors were encountered: