question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TransformError Using removed Babel 5 option when I import Provider

See original GitHub issue

Hello -

I looked through the issues and I do not see this a reference to this.

I have 2 projects with the exact same package dependencies with the exception of one being a react web app the the other being react native. I just started the native app with the following package.json dependencies:

  "dependencies": {
    "moment": "2.12.0",
    "react": "^0.14.8",
    "react-native": "^0.23.0",
    "react-redux": "4.4.1",
    "redux": "3.0.0",
    "redux-multi": "0.1.12",
    "redux-thunk": "1.0.3"
  },
  "devDependencies": {
    "babel-core": "6.3.26",
    "babel-preset-es2015": "6.5.0",
    "babel-preset-react": "6.5.0",
    "babel-preset-stage-0": "6.5.0",
    "babel-preset-stage-1": "6.5.0",
    "eslint": "2.3.0",
    "eslint-config-standard": "5.1.0",
    "eslint-plugin-promise": "1.1.0",
    "eslint-plugin-react": "4.1.0",
    "eslint-plugin-standard": "1.3.2"
  }

The app works fine until I try to import the Provider into my root node:

import { Provider } from 'react-redux'

The app then throws an error on the iOS simulator just from importing Provider and not even using it. I am using the iPhone 5 on v 9.3

TransformError: 
/native/node_modules/redux/lib/index.js: [BABEL] 
/native/node_modules/redux/lib/index.js: Using removed Babel 5 option: 
/native/node_modules/redux/.babelrc.stage 
- Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets

Here is my .babelrc as I have seen

{
  "presets": ["es2015", "stage-0", "stage-1", "react"]
}

I have verified that I only have one instance of react installed. I have pruned my node_modules. I am really not sure where to go next with this issue and would love all any help that can be provided.

Thanks,

Jordan

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
markeriksoncommented, Apr 8, 2016

Well, as a first observation: you only need a single “stage” preset. The lower numbered presets include the higher stages as well.

0reactions
jordanpapaleocommented, Apr 8, 2016

Ok so I used a different package for babel and now it seems to be working. Here is my current config:

package.json

"devDependencies": {
    "babel-core": "^6.4.5",
    "babel-preset-react-native": "^1.5.6"
  }

.babelrc

{
  "presets": ["react-native"]
}

Thanks for stepping through this with me.

Jordan

Read more comments on GitHub >

github_iconTop Results From Across the Web

using removed babel 5 option base.stage - Stack Overflow
The error means that the grunt definition for babelify is obsolete and invalid. It does not accept an option named stage anymore.
Read more >
@babel/preset-react | Yarn - Package Manager
Intro. Babel is a tool that helps you write code in the latest version of JavaScript. When your supported environments don't support certain...
Read more >
Webpack 2 – Using removed Babel 5 option: foreign.modules
Hello all, You can find this issue while migrating a project with a .babelrc file to Webpack 2. In my case it was...
Read more >
babel/preset-react
Decides which runtime to use. automatic auto imports the functions that JSX transpiles to. classic does not automatic import anything. development.
Read more >
babel-plugin-transform-react-remove-prop-types - Bountysource
Transform error with mode=wrap for TypeScript class component static propTypes ... Feature request: Option to remove imports of custom propTypes in current ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found