Closed ruslantalpa closed 8 years ago
something close to this https://github.com/istarkov/babel-plugin-webpack-loaders/issues/113 seems to indicate it might be a babelrc config issue
duplicate https://github.com/relayjs/relay-starter-kit/issues/66 sorry
Actually #66 says it's tracked in https://github.com/facebook/relay/issues/832 and that issue seems to be closed/fixed
I also remember that this used to work with node 5 just a few days ago, then i deleted node_modules
from the project dir, did a install, and this is when it failed.
~$ node -v
v5.10.1
~$ npm -v
3.8.3
it also fails with
~$ node -v
v4.5.0
~$ npm -v
2.15.9
yeah getting it too, think it worked 2 days ago.
Error: Plugin 0 specified in "foreign" provided an invalid property of "_c"
FWIW, replacing the inline plugin with https://github.com/BerndWessels/babel-relay-plugin-loader did the trick for me.
diff --git a/.babelrc b/.babelrc
index 6a1d5dc..cc957c8 100644
--- a/.babelrc
+++ b/.babelrc
@@ -1,13 +1,19 @@
{
- "passPerPreset": true,
"presets": [
- {
- "plugins": [
- "./build/babelRelayPlugin"
- ]
- },
"react",
"es2015",
"stage-0"
- ]
+ ],
+ "env": {
+ "development": {
+ "plugins": [
+ "babel-relay-plugin-loader"
+ ]
+ },
+ "production": {
+ "plugins": [
+ "babel-relay-plugin-loader"
+ ]
+ }
+ },
}
diff --git a/package.json b/package.json
index 02d698c..c906192 100644
--- a/package.json
+++ b/package.json
@@ -16,6 +16,7 @@
"babel-preset-react": "^6.11.1",
"babel-preset-stage-0": "6.5.0",
"babel-relay-plugin": "0.9.2",
+ "babel-relay-plugin-loader": "^0.9.0",
"chokidar": "1.6.0",
"classnames": "2.2.5",
"express": "4.14.0",
@@ -31,5 +32,10 @@
},
"devDependencies": {
"babel-cli": "6.11.4"
+ },
+ "metadata": {
+ "graphql": {
+ "schema": "./data/schema.json"
+ }
}
}
The above patch fixes the issue for me too. Thanks @lfittl
Thanks for the discussion everybody.
We're planning to release a new version of Relay this week (0.9.3). I am not sure how many people are affected by this error, and we have a workaround, so my proposal is to close this for now. Once 0.9.3 is out, we should update the relay-starter-kit's dependency on it.
If things are still broken for some people, I'd be open to merging a PR that adds the babel-relay-plugin-loader package, but that would be separate from this issue.
pull request https://github.com/relayjs/relay-starter-kit/pull/94
Can you help me with this?
ERROR in ./source/App.js Module build failed: Error: Plugin 19 specified in "E:\ReactTest\ho la-mundo\node_modules\babel-preset-es2015\index.js" provided an in valid property of "__esModule" at Plugin.init (E:\ReactTest\hola-mundo\node_modules\babel-core\l ib\transformation\plugin.js:124:13) at Function.normalisePlugin (E:\ReactTest\hola-mundo\node_modules \babel-core\lib\transformation\file\options\option-manager.js:155:12) at E:\ReactTest\hola-mundo\node_modules\babel-core\lib\transforma tion\file\options\option-manager.js:184:30 at Array.map (native) at Function.normalisePlugins (E:\ReactTest\hola-mundo\node_module s\babel-core\lib\transformation\file\options\option-manager.js:161:20 ) at OptionManager.mergeOptions (E:\ReactTest\hola-mundo\node_modul es\babel-core\lib\transformation\file\options\option-manager.js:254:3 6) at OptionManager.mergePresets (E:\ReactTest\hola-mundo\node_modul es\babel-core\lib\transformation\file\options\option-manager.js:308:1 6) at OptionManager.mergeOptions (E:\ReactTest\hola-mundo\node_modules\babel-core\lib\transformation\file\options\option-manager.js:270:12) at OptionManager.init (E:\ReactTest\hola-mundo\node_modules\babel-core\lib\transformation\file\options\option-manager.js:396:10) at File.initOptions (E:\ReactTest\hola-mundo\node_modules\babel-core\lib\transformation\file\index.js:191:75) @ multi main
package.json:
{ "name": "hello-app", "version": "1.0.0", "description": "", "scripts": { "start": "node_modules/.bin/webpack-dev-server --progress" }, "author": "", "license": "ISC", "devDependencies": { "babel-core": "~6.0.", "babel-loader": "~6.0.", "babel-preset-es2015": "~6.0.", "babel-preset-react": "~6.0.", "webpack": "^1.12.14", "webpack-dev-server": "^1.14.1" }, "dependencies": { "react": "^15.0.0", "react-dom": "^15.0.0" } }
webpack.config.js:
module.exports = { entry: [ './source/App.js' ], output: { path: __dirname, filename: 'bundle.js' }, module: { loaders: [{ test: /.jsx?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015','react'] } }] } };
Everything used to work even a few days ago but i am guessing something changed in the node/nmp packages and now there is this error
(complete output beginning with clone here http://pastebin.com/Gjkbn7UU)
i confirmed the error also with another person with a clean system