goatandsheep / react-native-dotenv

Load react native environment variables using import statements for multiple env files.
https://www.npmjs.com/package/react-native-dotenv
MIT License
795 stars 47 forks source link

error: index.js: [BABEL] C:\Users\m-s-b\newapp\index.js: .plugins is not a valid Plugin property #176

Closed mubarak90 closed 3 years ago

mubarak90 commented 3 years ago

Issuehunt badges

I have downloaded the package and when I run the app I am facing this issue, I have followed all steps in documentation. index.js:

import { AppRegistry } from 'react-native';
import App from './App';
import { name as appName } from './app.json';

AppRegistry.registerComponent(appName, () => App);

babel.config.js:

module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
  plugins: [
    [
      'module:react-native-dotenv',
      {
        moduleName: 'react-native-dotenv',
      },
    ],
  ],

};

package.json:

{
  "name": "newapp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@fortawesome/fontawesome-svg-core": "^1.2.32",
    "@fortawesome/free-brands-svg-icons": "^5.15.1",
    "@fortawesome/free-solid-svg-icons": "^5.15.1",
    "@fortawesome/react-fontawesome": "^0.1.13",
    "@fortawesome/react-native-fontawesome": "^0.2.6",
    "@react-native-async-storage/async-storage": "^1.13.2",
    "@react-native-community/geolocation": "^2.0.2",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-native-community/netinfo": "^5.9.10",
    "@react-native-mapbox-gl/maps": "^8.1.0",
    "@react-native-picker/picker": "^1.9.10",
    "@react-navigation/bottom-tabs": "^5.11.6",
    "@react-navigation/material-bottom-tabs": "^5.3.13",
    "@react-navigation/native": "^5.8.10",
    "@react-navigation/stack": "^5.12.8",
    "@voximplant/react-native-foreground-service": "^2.0.0",
    "axios": "^0.21.1",
    "base64-arraybuffer": "^0.2.0",
    "dotenv": "^10.0.0",
    "fs": "^0.0.1-security",
    "i": "^0.3.6",
    "mariadb": "^2.5.2",
    "npm": "^7.5.2",
    "path": "^0.12.7",
    "react": "16.13.1",
    "react-csv": "^2.0.3",
    "react-dark-mode-toggle": "0.0.10",
    "react-data-export": "^0.6.0",
    "react-native": "0.63.4",
    "react-native-animatable": "^1.3.3",
    "react-native-awesome-alerts": "^1.4.2",
    "react-native-camera": "^3.40.0",
    "react-native-circular-progress": "^1.3.6",
    "react-native-clean-project": "^3.6.4",
    "react-native-dialog-component": "^0.2.17",
    "react-native-dialog-input": "^1.0.8",
    "react-native-dotenv": "^0.2.0",
    "react-native-dropdownalert": "^4.3.0",
    "react-native-elements": "^3.0.0-alpha.1",
    "react-native-flash-message": "^0.1.23",
    "react-native-fontawesome": "^7.0.0",
    "react-native-freshchat-sdk": "^3.3.0",
    "react-native-fs": "^2.16.6",
    "react-native-geocoding": "^0.5.0",
    "react-native-geolocation-service": "^5.2.0",
    "react-native-gesture-handler": "^1.9.0",
    "react-native-image-picker": "^3.2.1",
    "react-native-indicators": "^0.17.0",
    "react-native-internet-connection-alert": "^0.1.4",
    "react-native-keyboard-aware-scrollview": "^2.1.0",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-maps": "0.27.1",
    "react-native-notifications": "^3.4.2",
    "react-native-onboarding-swiper": "^1.1.4",
    "react-native-paper": "^4.7.1",
    "react-native-progress": "^4.1.2",
    "react-native-reanimated": "^1.13.2",
    "react-native-restart": "^0.0.17",
    "react-native-safe-area-context": "^3.1.9",
    "react-native-screens": "^2.16.1",
    "react-native-shadow": "^1.2.2",
    "react-native-situm-plugin": "0.0.10",
    "react-native-svg": "^12.1.0",
    "react-native-swipe-modal-up-down": "^1.0.9",
    "react-native-swipe-up-down": "^1.0.7",
    "react-native-table-component": "^1.2.1",
    "react-native-timetable": "^1.0.4",
    "react-native-toast-message": "^1.4.9",
    "react-native-touchable-scale": "^2.1.2",
    "react-native-user-agent": "^2.1.0",
    "react-native-vector-icons": "^7.1.0",
    "react-redux": "^7.2.2",
    "redux": "^4.0.5",
    "redux-thunk": "^2.3.0",
    "xlsx": "^0.16.9"
  },
  "devDependencies": {
    "@babel/core": "^7.8.4",
    "@babel/runtime": "^7.8.4",
    "@react-native-community/eslint-config": "^1.1.0",
    "babel-jest": "^25.1.0",
    "eslint": "^6.5.1",
    "jest": "^25.1.0",
    "metro-react-native-babel-preset": "^0.59.0",
    "react-test-renderer": "16.13.1"
  },
  "jest": {
    "preset": "react-native"
  }
}


<!-- Issuehunt content -->

---

<details>
<summary>
<b>IssueHunt Summary</b>
</summary>

### Backers (Total: $0.00)

#### [Become a backer now!](https://issuehunt.io/r/goatandsheep/react-native-dotenv/issues/176)
#### [Or submit a pull request to get the deposits!](https://issuehunt.io/r/goatandsheep/react-native-dotenv/issues/176)
### Tips

- Checkout the [Issuehunt explorer](https://issuehunt.io/r/goatandsheep/react-native-dotenv/) to discover more funded issues.
- Need some help from other developers? [Add your repositories](https://issuehunt.io/r/new) on IssueHunt to raise funds.
</details>
<!-- /Issuehunt content-->
github-actions[bot] commented 3 years ago

Hey, thank you for opening this issue! 🙂 To boost priority on this issue and support open source please tip the team at https://issuehunt.io/r/goatandsheep/react-native-dotenv/issues/176

issuehunt-oss[bot] commented 3 years ago

An anonymous user has funded $2.00 to this issue.


issuehunt-oss[bot] commented 3 years ago

An anonymous user has cancelled funding for this issue. (Cancelled amount: $2.00) See it on IssueHunt

goatandsheep commented 3 years ago

@mubarak90 I'm happy you were able to figure it out!

mehdiamiri1440 commented 2 years ago

same problem!! someone help please !!

lakardion commented 10 months ago

So what was it ? I'm having this exact error and have no clue what is going on