react-native: [0.46] ReferenceError: Unknown plugin "transform-runtime"

Is this a bug report?

Yes

Have you read the Bugs section of the Contributing to React Native Guide?

Yes

Environment

  1. react-native -v: react-native-cli: 2.0.1 react-native: 0.46.0
  2. node -v: v7.6.0
  3. npm -v: 5.0.3
  4. yarn --version (if you use Yarn): 0.24.6

Then, specify:

  1. Target Platform (e.g. iOS, Android): iOS
  2. Development Operating System (e.g. macOS Sierra, Windows 10): macOS
  3. Build tools (Xcode or Android Studio version, iOS or Android SDK version, if relevant):

Steps to Reproduce

(Write your steps here:)

  1. react-native init
  2. yarn
  3. react-native run-ios

Expected Behavior

Open iOS simulator with the hello world app

Actual Behavior

Packager fails

/Users/xx/test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:328
        throw e;
        ^

ReferenceError: Unknown plugin "transform-runtime" specified in "/Users/xx/test/node_modules/regenerator-transform/package.json" at 0, attempted to resolve relative to "/Users/xx/test/node_modules/regenerator-transform" (While processing preset: "/Users/xx/test/node_modules/babel-preset-react-native/index.js")
    at /Users/xx/test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:180:17
    at Array.map (native)
    at Function.normalisePlugins (/Users/xx/test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
    at OptionManager.mergeOptions (/Users/xx/test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
    at OptionManager.init (/Users/xx/test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at compile (/Users/xx/test/node_modules/babel-register/lib/node.js:103:45)
    at loader (/Users/xx/test/node_modules/babel-register/lib/node.js:144:14)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/xx/test/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
Process terminated. Press <enter> to close the window


Reproducible Demo

init a new project

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 44
  • Comments: 35 (3 by maintainers)

Most upvoted comments

Doing this :

rm -rf .babelrc

solves the issue temporarily

Manual react-native start works for me too after building everything else, as a workaround.

But the usual and complete react-native run-ios workflow is busted and still need fixing, obviously. The other workarounds posted previously (with .babelrc and such) doesn’t work for me.

This is happening on an existing project I just upgraded to 0.46.

I got it working by deleting .babelrc as per @javierM84

Closing the terminated process and booting up the packager via react-native start seems to work

I have the exact same issue when running run-android, while run-ios is working fine.

The problem occurs on newly generated projects, my existing projects run fine.

I also have the same issue. This is a temporary fix because I changed previous react-native package.json.

  1. delete node_modules
  2. change package.json
...
 "dependencies": {
        "react": "16.0.0-alpha.12",
	"react-native": "0.45.1"
},
"devDependencies": {
	"babel-jest": "20.0.3",
	"babel-preset-react-native": "2.0.0",
	...
},
...
  1. do npm install
  2. react-native run-ios

No need for manual install or deletes. With yarn, all you need is yarn upgrade. https://github.com/facebook/react-native/issues/14530#issuecomment-313747461

@javierM84 thanks it works for me on RN 0.46