Import Failed in React native
Jagadeesh-Govindaraj opened this issue · 2 comments
Jagadeesh-Govindaraj commented
import sortBy from 'array-sort-by'; iam using es2015 syntax to import js files
error: bundling: ReferenceError: Unknown plugin "babel-plugin-add-module-exports" specified in "/Users/jagadeesh/Projects/working/xxx/Presentation/yyyy/node_modules/array-sort-by/package.json" at 0, attempted to resolve relative to "/Users/jagadeesh/Projects/working/xxx/Presentation/yyyy/node_modules/array-sort-by"
at /Users/jagadeesh/Projects/working/xxx/Presentation/yyyy/node_modules/babel-core/lib/transformation/file/options/option-manager.js:180:17
at Array.map (native)
at Function.normalisePlugins (/Users/jagadeesh/Projects/working/xxx/Presentation/yyyy/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
at OptionManager.mergeOptions (/Users/jagadeesh/Projects/working/xxxx/Presentation/yyyy/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
at OptionManager.init (/Users/jagadeesh/Projects/working/xxxx/Presentation/yyyy/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
at File.initOptions (/Users/jagadeesh/Projects/working/xxx/Presentation/yyyy/node_modules/babel-core/lib/transformation/file/index.js:212:65)
at new File (/Users/jagadeesh/Projects/working/xxxx/Presentation/yyyy/node_modules/babel-core/lib/transformation/file/index.js:135:24)
at Pipeline.transform (/Users/jagadeesh/Projects/working/xxx/Presentation/yyyy/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
at Object.transform (/Users/jagadeesh/Projects/working/iCommandV3/Presentation/yyyy/node_modules/react-native/packager/transformer.js:109:25)
jherax commented
Hi, are you using Webpack, 2x, 3x?
jherax commented
Hi @Jagadeesh-Govindaraj, when including source code from a library you should add the dependencies from that package, in this case you should add the package "babel-plugin-add-module-exports" to your package.json.