bundling failed: Error: Plugin 0 provided an invalid property of “default”

♀尐吖头ヾ 提交于 2019-11-29 04:13:21

This is bug in babel-preset-react-native

Set the version:

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

Its some incompatible versioning problems in React native.Try this it will work

1.Change versions of following in package.json

In dependencies :-

  "react": "16.3.1"
  "react-native": "0.55.4"

In devDependencies :-

  "babel-preset-react-native": "2.1.0"

2. Delete node_modules and run npm install --save

  1. Then run application by react-native run-android

It will run fine ...

Should use the jest to latest version, it can works "babel-jest": "23.3.0", "babel-preset-react-native": "5.0.2", "jest": "23.3.0",

Well it may be late , but i will help other as below package.json is working till date 20.aug.2018

Below package.json most of dependencies like axios, Redux, Native base, react-native-router-flux ..etc used in react native projects, so version i mentioned below compatible to each other. Cheers.

{
  "name": "Example",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "resolutions": {
    "*/@babel/cli": "7.0.0-beta.54",
    "*/@babel/core": "7.0.0-beta.54",
    "*/@babel/code-frame": "7.0.0-beta.54"
  },
  "dependencies": {
    "axios": "^0.18.0",
    "eslint": "^5.2.0",
    "native-base": "2.6.1",
    "prop-types": "^15.6.2",
    "react": "16.3.1",
    "react-native": "0.55.4",
    "react-native-router-flux": "^4.0.1",
    "react-native-timeline-listview": "^0.2.3",
    "react-navigation": "^2.11.2",
    "react-redux": "^5.0.7",
    "redux": "^4.0.0",
    "redux-logger": "^3.0.6",
    "redux-thunk": "^2.3.0"
  },
  "devDependencies": {
    "babel-jest": "23.4.2",
    "babel-preset-react-native": "4.0.0",
    "jest": "23.5.0",
    "react-test-renderer": "16.4.1"
  },
  "jest": {
    "preset": "react-native"
  }

}

I had this issue, I needed to downgrade babel-preset-react-native version.

If you use yarn

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

or use npm commands

npm uninstall babel-preset-react-native
npm install babel-preset-react-native@4.0.0
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!