jordaaash / babel-plugin-transform-inline-environment-variables

8 stars 4 forks source link

TypeError: Cannot assign to read only property 'undefined' of #<Object> #1

Open note89 opened 8 years ago

note89 commented 8 years ago

Hi when i add

"plugins" : ["transform-inline-environment-variables"]

to .babelrc get the following error when building my react-native bundle

$ react-native bundle --platform android --entry-file index.android.js --bundle-output derp.jsbundle bundle --platform andr/home/nils/Programmering/ahead/ahead_mobile/node_modules/promise/lib/done.js:10
      throw err;
      ^

TypeError: Cannot assign to read only property 'undefined' of #<Object>
    at /home/nils/Programmering/ahead/ahead_mobile/node_modules/react-native/local-cli/bundle/buildBundle.js:32:7
    at tryCallTwo (/home/nils/Programmering/ahead/ahead_mobile/node_modules/promise/lib/core.js:45:5)
    at doResolve (/home/nils/Programmering/ahead/ahead_mobile/node_modules/promise/lib/core.js:200:13)
    at new Promise (/home/nils/Programmering/ahead/ahead_mobile/node_modules/promise/lib/core.js:66:3)
    at buildBundle (/home/nils/Programmering/ahead/ahead_mobile/node_modules/react-native/local-cli/bundle/buildBundle.js:24:10)
    at bundleWithOutput (/home/nils/Programmering/ahead/ahead_mobile/node_modules/react-native/local-cli/bundle/bundle.js:24:10)
    at Array.bundle (/home/nils/Programmering/ahead/ahead_mobile/node_modules/react-native/local-cli/bundle/bundle.js:29:10)
    at Object.run (/home/nils/Programmering/ahead/ahead_mobile/node_modules/react-native/local-cli/cliEntry.js:95:3)
    at Object.<anonymous> (/home/nils/.nvm/versions/node/v5.2.0/lib/node_modules/react-native-cli/index.js:88:7)
    at Module._compile (module.js:399:26)

package.json

{
  "name": "ahead_mobile",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start"
  },
  "dependencies": {
    "babel-plugin-transform-inline-environment-variables": "^6.8.0",
    "lodash.debounce": "^4.0.6",
    "moment": "^2.14.1",
    "react": "15.2.1",
    "react-native": "^0.30.0",
    "react-native-code-push": "^1.14.1-beta",
    "react-native-fbsdk": "^0.3.0",
    "react-native-maps": "^0.7.1",
    "react-native-modal-picker": "0.0.16",
    "react-native-parallax-view": "^2.0.5",
    "react-native-scrollable-tab-view": "^0.5.3",
    "react-native-vector-icons": "^2.0.3",
    "react-relay": "^0.9.2"
  },
  "devDependencies": {
    "babel-core": "^6.11.4",
    "babel-preset-react-native": "^1.9.0",
    "babel-relay-plugin": "^0.9.2",
    "eslint": "^3.3.0",
    "graphql": "^0.6.2",
    "sync-request": "^3.0.1"
  }
}

node v5.2

$ node -v
v5.2.0

Same issue with latest node version. on both OSX and Ubuntu.

nickarora commented 6 years ago

For those in a similar situation, try adding "ignore": ["node_modules"]to your .babelrc