4

The application is installed in the emulator. But it is not starting. Emulator points me out this error.

At the same time server gives following errors.

error: bundling failed: TypeError: Cannot read property 'throwIfClosureRequired' of undefined (While processing preset: "C:\Users\sajithk\UTransP\node_modules\babel-preset-react-native\index.js") at _default (C:\Users\sajithk\UTransP\node_modules\babel-preset-react-native\node_modules\@babel\plugin-transform-block-scoping\lib\index.js:19:36) at Function.memoisePluginContainer (C:\Users\sajithk\UTransP\node_modules\babel-core\lib\transformation\file\options\option-manager.js:113:13) at Function.normalisePlugin (C:\Users\sajithk\UTransP\node_modules\babel-core\lib\transformation\file\options\option-manager.js:146:32) at C:\Users\sajithk\UTransP\node_modules\babel-core\lib\transformation\file\options\option-manager.js:184:30 at Array.map () at Function.normalisePlugins (C:\Users\sajithk\UTransP\node_modules\babel-core\lib\transformation\file\options\option-manager.js:158:20) at OptionManager.mergeOptions (C:\Users\sajithk\UTransP\node_modules\babel-core\lib\transformation\file\options\option-manager.js:234:36) at C:\Users\sajithk\UTransP\node_modules\babel-core\lib\transformation\file\options\option-manager.js:265:14 at C:\Users\sajithk\UTransP\node_modules\babel-core\lib\transformation\file\options\option-manager.js:323:22 BUNDLE [android, dev] ./index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1), failed.

This is the first time i ran the application in the emulator after creating the project.

M Reza
  • 18,350
  • 14
  • 66
  • 71
Sajith
  • 713
  • 6
  • 21

4 Answers4

4

I had the same problem and in my case I solved it by changing the babel-preset-react-native version from 5.0.0 to 4.0.0

And follow the instructions:

  1. Clear watchman watches: watchman watch-del-all.
  2. Delete the node_modules folder: rm -rf node_modules && npm install.
  3. Reset Metro Bundler cache: rm -rf /tmp/metro-bundler-cache-* or npm start -- --reset-cache.
  4. Remove haste cache: rm -rf /tmp/haste-map-react-native-packager-*.
gyss
  • 1,753
  • 4
  • 23
  • 31
0

What's your babel-preset-react-native version?

Try this command:

npm install --save babel-preset-react-native@2.1.0
M Reza
  • 18,350
  • 14
  • 66
  • 71
0

in console: npx react-native start

dev_event
  • 1
  • 1
-2
npm install react-navigation --save

I used the above fixed my issue, if anyone have same issue, just try. if anyone know why this command can fix the issue, I am happy to learn. Cheers

黄鲁皖
  • 1
  • 1