Reactjs 在';国外';提供了无效的属性'_c';
使用下面的配置获取上面的错误,我应该如何使其工作 .LRC:Reactjs 在';国外';提供了无效的属性'_c';,reactjs,babeljs,graphql,relay,Reactjs,Babeljs,Graphql,Relay,使用下面的配置获取上面的错误,我应该如何使其工作 .LRC: { "passPerPreset": true, "presets": [ {"plugins": ["./build/babelRelayPlugin"]}, "react", "es2015", "stage-0" ] } package.json: { "name": "1", "version": "1.0.0", "description": "", "main"
{
"passPerPreset": true,
"presets": [
{"plugins": ["./build/babelRelayPlugin"]},
"react",
"es2015",
"stage-0"
]
}
package.json:
{
"name": "1",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"babel-core": "^6.14.0",
"babel-loader": "^6.2.5",
"babel-polyfill": "^6.13.0",
"babel-preset-es2015": "^6.14.0",
"babel-preset-react": "^6.11.1",
"babel-preset-stage-0": "^6.5.0",
"babel-relay-plugin": "^0.9.2",
"express": "^4.14.0",
"express-graphql": "^0.5.3",
"graphql": "^0.6.2",
"graphql-relay": "^0.4.2",
"react": "^15.3.1",
"react-dom": "^15.3.1",
"react-relay": "^0.9.2",
"webpack": "^1.13.2",
"webpack-dev-server": "^1.15.0"
},
"devDependencies": {
"babel-cli": "^6.14.0"
}
}
server.js:
//
//
//
const compiler = webpack({
entry: path.resolve(__dirname, 'js', 'app.js'),
module: {
loaders: [
{
test: /\.js$/,
include: [ path.resolve(__dirname, "js") ],
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['react', 'es2015', 'stage-0'],
},
}
],
},
output: {filename: '/app.js', path: '/', publicPath: '/js/'}
});
const appServer = new WebpackDevServer(compiler, {
contentBase: '/public/',
proxy: {'/graphql': 'http://localhost:8000'},
publicPath: '/js/',
stats: {colors: true}
});
//
//
//
终端错误:babel node server.js
./js/app.js中出现错误模块生成失败:错误:“foreign”中指定的插件0提供了无效的“\u c”属性 浏览器错误:localhost:3000 在控制台窗口中:
未捕获不变冲突:RelayQL:运行时发生意外调用。可能是没有设置Babel转换,或者无法识别此呼叫站点。确保它被逐字用作
Relay.QL
我已经成功地使用了以下设置。我在我的网页模块中使用带有babel加载程序的插件,而不是在中使用。babelrc
在网页中:
query: {
presets: [
"es2015", "react", "stage-0", {
"plugins": [
"./schema-build/babelRelayPlugin"
]
}
]
}
在法律改革委员会:
{
"passPerPreset": true,
"presets": [
"react",
"es2015",
"stage-0"
]
}