You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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.
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.
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
The text was updated successfully, but these errors were encountered: