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

[0.46] ReferenceError: Unknown plugin "transform-runtime" #14843

Closed
BrendonSled opened this issue Jul 5, 2017 · 35 comments
Closed

[0.46] ReferenceError: Unknown plugin "transform-runtime" #14843

BrendonSled opened this issue Jul 5, 2017 · 35 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@BrendonSled
Copy link

BrendonSled commented Jul 5, 2017

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

@BrendonSled BrendonSled changed the title ReferenceError: Unknown plugin "transform-runtime" [0.46] ReferenceError: Unknown plugin "transform-runtime" Jul 5, 2017
@joostslijkoort
Copy link

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.

@mayusha
Copy link

mayusha commented Jul 5, 2017

+1

@dn-l
Copy link

dn-l commented Jul 5, 2017

Same, run-ios

@ryanwhiley
Copy link

+1

1 similar comment
@fjmorant
Copy link

fjmorant commented Jul 5, 2017

+1

@Nismit
Copy link

Nismit commented Jul 5, 2017

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

@fjmorant
Copy link

fjmorant commented Jul 5, 2017

Doing this :

rm -rf .babelrc

solves the issue temporarily

@chishui
Copy link

chishui commented Jul 5, 2017

same issue here. And @JavierM84 's solution works for me.

@andrezacds
Copy link

Same here!

@ronal2do
Copy link
Contributor

ronal2do commented Jul 6, 2017

+1

@0xdavinchee
Copy link

Worked for me too!

@ronal2do
Copy link
Contributor

ronal2do commented Jul 6, 2017

@Nismit worked to mee

@waseemshahwan
Copy link

+1

@fungilation
Copy link

fungilation commented Jul 6, 2017

Same. Reproduced on 0.46.0, was on 0.45.1 without issue. On MacOS, running react-native run-ios > React Packager terminal output:

/Users/<user>/Documents/code/<RN_project_name>/node_modules/babel-core/lib/transformation/file/options/option-manager.js:328
        throw e;
        ^

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

Tried removing .babelrc and run-ios terminates on a different babel plugin I'm using, idx:

/Users/<user>/Documents/code/<project>/node_modules/babel-core/lib/transformation/file/options/option-manager.js:180
          throw new ReferenceError(messages.get("pluginUnknown", plugin, loc, i, dirname));
          ^

ReferenceError: Unknown plugin "idx" specified in "/Users/<user>/Documents/code/.babelrc" at 0, attempted to resolve relative to "/Users/<user>/Documents/code"
    at /Users/<user>/Documents/code/<project>/node_modules/babel-core/lib/transformation/file/options/option-manager.js:180:17
    at Array.map (native)
    at Function.normalisePlugins (/Users/<user>/Documents/code/<project>/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
    at OptionManager.mergeOptions (/Users/<user>/Documents/code/<project>/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
    at OptionManager.init (/Users/<user>/Documents/code/<project>/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at compile (/Users/<user>/Documents/code/<project>/node_modules/babel-register/lib/node.js:103:45)
    at loader (/Users/<user>/Documents/code/<project>/node_modules/babel-register/lib/node.js:144:14)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/<user>/Documents/code/<project>/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
Process terminated. Press <enter> to close the window

@mattfysh
Copy link

mattfysh commented Jul 6, 2017

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

@WangPinChieh
Copy link

@JavierM84 's solution works!

@malkhalaf
Copy link

+1
Just happened for every new project I create today with 0.46. All current projects work perfectly.
workaround: Running packager while at the new project folder using react-native start

@fungilation
Copy link

fungilation commented Jul 6, 2017

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.

@thatjuan
Copy link

thatjuan commented Jul 6, 2017

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

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

@ArnonHongklay
Copy link

@fungilation it works!

@lslvxy
Copy link

lslvxy commented Jul 6, 2017

+1

1 similar comment
@yogieputra8
Copy link

+1

@anhld
Copy link

anhld commented Jul 6, 2017

Same issue, + 1.

@namqdam
Copy link

namqdam commented Jul 6, 2017

I change "babel-preset-react-native" back to version "2.0.0" and everything is working.

@messense
Copy link

messense commented Jul 6, 2017

+1

@JimmyDaddy
Copy link

JimmyDaddy commented Jul 6, 2017

I got this problem too.
If I delete .babelrc I will encounter this problem #14209
So I checked regenerator-transform/package.json found

"devDependencies": {
    "babel-cli": "^6.9.0",
    "babel-plugin-transform-runtime": "^6.9.0",
    "babel-preset-env": "^1.2.2"
  },

babel-clibabel-plugin-transform-runtimebabel-preset-env haven't installed in node_modules, so I installed them all.
Then I got this guy says Couldn't find preset "es2015" relative to directory ...blabla, so I installed babel-preset-es2015
After that I reencountered #14209. T_T

@tomislavHonig
Copy link

Can someone who has working version of react native 0.46 project paste a package.json file?

@dioxide
Copy link

dioxide commented Jul 6, 2017

+1

@namqdam
Copy link

namqdam commented Jul 6, 2017

my working package for react native 0.46.0
https://gist.github.com/namdq1969/f82b7ac8157b2db8f6bdf5e19463d8e7

@grabbou
Copy link
Contributor

grabbou commented Jul 6, 2017

Duplicate of #14530

@fungilation
Copy link

@tomislavHonig @grabbou my package.json:

{
  "name": "<name>",
  "version": "0.0.1",
  "private": true,
  "eslintConfig": {
    "parserOptions": {
      "ecmaVersion": 6,
      "sourceType": "module",
      "ecmaFeatures": {
        "jsx": true,
        "experimentalObjectRestSpread": true
      }
    },
    "env": {
      "browser": true,
      "node": true
    },
    "plugins": [
      "react",
      "react-native"
    ],
    "rules": {
      "comma-dangle": [
        2,
        "always-multiline"
      ],
      "semi": [
        2,
        "never"
      ],
      "react-native/no-unused-styles": 2,
      "react-native/split-platform-components": 2
    }
  },
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start"
  },
  "dependencies": {
    "babel-plugin-idx": "^1.1.0",
    "bugsnag-react-native": "^2.2.3",
    "he": "^1.1.0",
    "lodash": "^4.17.2",
    "moment-timezone": "^0.5.10",
    "node-summary": "file:../node-summary/",
    "react": "16.0.0-alpha.12",
    "react-native": "0.46.0",
    "react-native-blur": "^3.1",
    "react-native-code-push": "3.0.1-beta",
    "react-native-firebase-analytics": "^3.0.0",
    "react-native-fit-image": "^1.4.8",
    "react-native-highlight-words": "^1.0.0",
    "react-native-keep-awake": "^2.0.4",
    "react-native-linear-gradient": "^2.0.0",
    "react-native-modalbox": "^1.3.8",
    "react-native-notification": "^2.0.0",
    "react-native-orientation": "file:../react-native-orientation-RN0.40/",
    "react-native-parallax-scroll-view": "^0.19.0",
    "react-native-safari-view": "^2.0.0",
    "react-native-status-bar-size": "^0.3.2",
    "react-native-swiper": "^1.5.4",
    "react-native-tooltip": "^5.0.0",
    "react-native-tts": "^1.3.0",
    "react-native-vector-icons": "^4.1.1",
    "react-native-webview-bridge": "file:../react-native-webview-bridge-RN0.40/",
    "react-redux": "^5.0.1",
    "realm": "^1.3.1",
    "redux": "^3.6.0",
    "redux-thunk": "^2.1.0"
  },
  "devDependencies": {
    "redux-logger": "^3.0.6"
  }
}

.babelrc:

{
  "presets": ["react-native"],
  "plugins": ["idx"]
}

@gonglong
Copy link

gonglong commented Jul 7, 2017

@JavierM84 thanks it works for me on RN 0.46

@SoundBlaster
Copy link

No need to delete Babel config - it's important part of the app. Restarting the Terminal and calling the react-native start command help me.

@teaualune
Copy link

I managed to solve the issue temporarily without removing .babelrc by

  1. install metro-bundler@0.7.8
  2. rm -rf node_modules/react-native/node_modules/metro-bundler

#14530 has more details on this

@fungilation
Copy link

No need for manual install or deletes. With yarn, all you need is yarn upgrade. #14530 (comment)

@facebook facebook locked as resolved and limited conversation to collaborators Jul 6, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests