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

error: bundling failed: "TransformError [...] (While processing preset: node_modules [... \\babel-preset-react-native\\index.js")" #15545

Closed
tudor2it opened this issue Aug 18, 2017 · 25 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@tudor2it
Copy link

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

No

Environment

  1. react-native -v: react-native-cli: 2.0.1
  2. node -v: v6.11.2
  3. npm -v: 3.10.10
  4. yarn --version: not using

Then, specify:

  • Target Platform: Android
  • Development Operating System: Windows 7 Professional SP1 x86_64
  • Build tools: Android Studio 2.3.3, JRE 1.8.0_122, Android SDK Tools 26.0.2

Steps to Reproduce

(Write your steps here:)

  1. D:\path\path>react-native init project
  2. cd project
  3. react-native run-android

Expected Behavior

The welcome React-Native screen should appear on the emulator screen.

Actual Behavior

It throws the below error:

React packager ready.

Loading dependency graph, done.
Bundling `index.android.js`  [development, non-minified, hmr disabled]  ░░░░░░░░░░░░░
Bundling `index.android.js`  [development, non-minified, hmr disabled]  0.0% (0/1), f
ailed.
Bundling `index.android.js`  [development, non-minified, hmr disabled]  ░░░░░░░░░░░░░
error: bundling failed: "TransformError: D:\\path\\path\\project\\index.android.js: Unex
pected token ) (While processing preset: \"D:\\\\path\\\\path\\\\project\\\\node_modules
\\\\babel-preset-react-native\\\\index.js\")"

image

Reproducible Demo

It is an empty standard project as it is described in https://facebook.github.io/react-native/docs/getting-started.html > Building Projects with Native Code.

@Kennytian
Copy link

Kennytian commented Aug 18, 2017

some issue +1

@tudor2it work around: npm install --save-dev babel-preset-react-native@2.1.0

@emilioicai
Copy link
Contributor

emilioicai commented Aug 18, 2017

+1
@Kennytian workaround fixed it

@tudor2it
Copy link
Author

@Kennytian Thank you for the solution. I have known about the workaround. The issue has appeared a few days ago and I've expected to disappear. But it is still there and it's frustrating that the react-native team didn't fix it. I'm desperate to finish a project and I'm only struggling with all kind of errors because versions of packages and compilers don't match.

@snoo-mpl
Copy link

+1
workaround didnt fix it in my app:

npm: 5.0.1
react-native-cli: 2.0.1
react-native: 0.47.1
node: v7.9.0

@charpeni
Copy link
Contributor

@facebook-github-bot duplicate #15513

@facebook-github-bot
Copy link
Contributor

Duplicate of #15513

@facebook-github-bot facebook-github-bot added the Ran Commands One of our bots successfully processed a command. label Aug 18, 2017
@ShubhamBabhulkar
Copy link

for yarn used following Commands

yarn remove babel-preset-react-native
yarn add babel-preset-react-native@2.1.0

for npm used following Commands

npm uninstall babel-preset-react-native
npm install babel-preset-react-native@2.1.0

@oliverraf
Copy link

oliverraf commented Aug 20, 2017

This works like a charm

@tudor2it work around: npm install --save-dev babel-preset-react-native@2.1.0

@kwesihackman
Copy link

workaround fixed it for me

@gjvpaet
Copy link

gjvpaet commented Aug 20, 2017

@Kennytian workaround fixed it thanks!

@uurtsaikhb
Copy link

@Kennytian workaround fixed it, thank you

@jmacias54
Copy link

@Kennytian fixed it, thank you so much

@vegano1
Copy link

vegano1 commented Aug 25, 2017

@ShubhamBabhulkar This fixed my issue as well. Thank you.

@Ghayyas
Copy link

Ghayyas commented Aug 27, 2017

@Kennytian Great Thanks it works.. 👍

@ChenYCL
Copy link

ChenYCL commented Aug 28, 2017

step1
npm install --save-dev babel-preset-react-native@2.1.0
step2
npm update

@duckdonghwan
Copy link

@Kennytian fixed it! Great Thanks it works.. 👍

@lavarajallu
Copy link

Gettting this Error In Ios

TransformError: /Users/stellent/Desktop/terapanth/index.ios.js: Couldn't find preset "babel-preset-react-native-stage-0/decorator-support" relative to directory "/Users/stellent/Desktop/terapanth"

@Shaunakdas
Copy link

Getting similar error in android

Couldn't find preset "babel-preset-react-native-stage-0/decorator-support" relative to directory 

@tekslave
Copy link

tekslave commented Jan 11, 2018

  1. Open '.babelrc' file in your project root and change the preset
{
  "presets": [
    "babel-preset-react-native-stage-0/decorator-support"
  ],
  "env": {
    "development": {
      "plugins": [
        "transform-react-jsx-source"
      ]
    }
  }
}

change to

{
  "presets": [
    "react-native"
  ],
  "env": {
    "development": {
      "plugins": [
        "transform-react-jsx-source"
      ]
    }
  }
}

@anderson9149
Copy link

npm reinstalls did not work for me. Only Yarn method

yarn remove babel-preset-react-native
yarn add babel-preset-react-native@2.1.0

changtimwu added a commit to changtimwu/react-native-boilerplate-mobx-state-tree-typescript that referenced this issue Apr 18, 2018
@Poukai
Copy link

Poukai commented Jul 12, 2018

I am getting error: bundling failed: TypeError: Cannot read property 'bindings' of null

@wesleyguirra
Copy link

wesleyguirra commented Jul 12, 2018

getting the same error here: Error: Cannot find module '@babel/core'

my package.json https://gist.github.com/wesleyguirra/11cdfbd8669b4783399a8a0bea29ce6a

@YouCii
Copy link

YouCii commented Jul 13, 2018

I love you ma~
@Kennytian

@imchathu87
Copy link

give this man (@Kennytian) a medal

@zhangmingnjun
Copy link

一直挣扎在版本,编译不匹配的坑里,rn team要加油!

@facebook facebook locked as resolved and limited conversation to collaborators Aug 18, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Aug 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests