「バベル-ポリフィルの1つのインスタンスのみが許可されている」私はこのエラーを診断し、固定助ける必要があります。がエラー
"Error: only one instance of babel-polyfill is allowed"
私はpackage.jsonに次き:
"devDependencies": {
"babel-core": "^6.23.1",
"babel-jest": "^19.0.0",
"babel-loader": "^6.3.2",
"babel-plugin-transform-object-rest-spread": "^6.23.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-react": "^6.23.0" ...
"dependencies": {
"babel-polyfill": "^6.23.0" ...
そして、これ私のwebpack設定のこの入力行は
entry: ["babel-polyfill", path.resolve(APP_PATH, 'index')],
...
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
// specify that we will be dealing with React code
presets: ['react', 'es2015']
}
}
]}
私のwebpack設定では、HtmlWebpackPluginが原因です。私はこのプラグインを削除すると、私はエラーが遠ざかります。 – foobar
エントリを変更しようとします:[path.resolve(APP_PATH、 'index')] – user3770494
babel-polyfillを使用していますので、それはどこかにある。代わりにインポートをどこかに追加することもできますが、同じエラーが発生します。私がそれを削除すると、エラーが発生します:Uncaught ReferenceError:regeneratorRuntimeが定義されていません。 – foobar