Skip to content
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

React Native Babel Preset Required #61

Open
kwelch opened this issue Apr 5, 2017 · 3 comments
Open

React Native Babel Preset Required #61

kwelch opened this issue Apr 5, 2017 · 3 comments

Comments

@kwelch
Copy link

kwelch commented Apr 5, 2017

I am getting the following error, on a fresh install of animated in a web app. I have no react-native code to this point and I didn't see any documentation and says it needed to be a RN project.

ERROR in ./~/animated/lib/index.js
Module build failed: Error: Couldn't find preset "react-native" relative to directory 

Once I installed babel-preset-react-native the project built and functioned as expected. I am not really sure why this is happening but I wanted to raise the flag. Simple fix would be to move the preset to be a peerDependency, but I would not expect a packaged lib to need a babel preset.

Stacktrace below

"/Users/welchk/_git/you-pick/node_modules/animated" at /Users/welchk/_git/you-pick/node_modules/babel-core/lib/transformation/file/options/option-manager.js:293:19 at Array.map (native) at OptionManager.resolvePresets (/Users/welchk/_git/you-pick/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20) at OptionManager.mergePresets (/Users/welchk/_git/you-pick/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10) at OptionManager.mergeOptions (/Users/welchk/_git/you-pick/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14) at OptionManager.init (/Users/welchk/_git/you-pick/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12) at File.initOptions (/Users/welchk/_git/you-pick/node_modules/babel-core/lib/transformation/file/index.js:212:65) at new File (/Users/welchk/_git/you-pick/node_modules/babel-core/lib/transformation/file/index.js:135:24) at Pipeline.transform (/Users/welchk/_git/you-pick/node_modules/babel-core/lib/transformation/pipeline.js:46:16) at transpile (/Users/welchk/_git/you-pick/node_modules/babel-loader/lib/index.js:46:20) at Object.module.exports (/Users/welchk/_git/you-pick/node_modules/babel-loader/lib/index.js:163:20) @ ./src/components/App/index.js 13:16-35 @ ./src/index.js @ multi (webpack)-dev-server/client?http://localhost:8080 babel-polyfill react-hot-loader/patch ./src/index.js
@browniefed
Copy link
Member

This library is intended to be used for both react-native and react for the web. However the one issue is that the web / react-native versions don't have separate builds just separate entry points.

This could definitely be improved however at the moment this isn't actively maintained.

@kwelch
Copy link
Author

kwelch commented Apr 6, 2017

Understandable, I will leave this open so it maintains visibility.

@souporserious
Copy link

I keep running into this issue 😞 is there any guidance on how this can be fixed? I'd be happy to put together a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants