私はReactチュートリアルを行っていて、セットアップ中に空の白い画面が表示されています。 npm startを実行すると白い画面しか表示されませんが、要素を調べると空白のdivが表示されます。ブランクの白い画面React&Webpack/Babelがバベルコアに移動しました
I found a similar issue here but the solution doesn't work for me
私は1つのエラーを取得する:バベルのノードAPIは、コアをバベルに移動されました。 @マルチメイン
githubファイルのすべての正確なファイルをコピーしましたが、これはまだ私が得ているものです。
私は既にnpm uninstall babel -gを試しましたが、それでも同じエラーと白い画面が表示されます。ここで
は、ここに私のwebpack.config.js
module.exports = {
entry: './main.js',
output: {
path: './',
filename: 'index.js'
},
devServer: {
inline: true,
port: 3333
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015', 'react']
}
}
]
}
}
である私のpackage.jsonは、私はnode_modulesを削除し、すべての依存関係をもう一度再インストールしようと、それは私のために働いた
{
"name": "es6-react-setup",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server"
},
"author": "",
"license": "ISC",
"dependencies": {
"babel-core": "^6.2.1",
"babel-loader": "^6.2.0",
"babel-preset-es2015": "^6.1.18",
"babel-preset-react": "^6.1.18",
"react": "^0.14.3",
"react-dom": "^0.14.3"
},
"description": "Setup files for React in ES6 lessons"
}