Ошибка сервера разработки Webpack: инвариантное нарушение: ошибка React Minified # 200 - PullRequest
0 голосов
/ 27 июня 2019

Я получаю ошибку заголовка в консоли браузера, когда он пытается загрузить файл index.html с тегом script в файл bundle.js.Я только что закончил урок, который указывал на / dist, с его собственным index.html и скомпилированным файлом main.js, поэтому я не понимаю, почему мой собственный bundle.js получает ошибку, связанную с минимизацией:

react-dom.production.min.js:13 Uncaught Invariant Violation: Minified React error #200; visit https://reactjs.org/docs/error-decoder.html?invariant=200 for the full message or use the non-minified dev environment for full errors and additional helpful warnings. 
    at http://localhost:8080/bundle.js:22:420
    at o (http://localhost:8080/bundle.js:22:523)
    at Object.render (http://localhost:8080/bundle.js:22:104077)
    at Module.<anonymous> (http://localhost:8080/bundle.js:6:1229)
    at P (http://localhost:8080/bundle.js:1:7211)
    at http://localhost:8080/bundle.js:1:8035
    at http://localhost:8080/bundle.js:1:8043
(anonymous) @   react-dom.production.min.js:13
o   @   react-dom.production.min.js:14
render  @   react-dom.production.min.js:266
(anonymous) @   index.jsx:16
P   @   bootstrap:726
(anonymous) @   bootstrap:793
(anonymous) @   bootstrap:793

Кто-нибудь знает, в чем проблема?Мой webpack.config.js ниже:

const webpack = require("webpack");
const dotenvWebpack = require("dotenv-webpack");
const path = require("path");

module.exports = {
  entry : {
    './adminSettingsArea' :
      './adminSettingsArea/src/index.jsx'
  },
  output : {
    filename : '[name]/bundle.js',
    path : path.resolve(__dirname),
  },
  devtool: 'inline-source-map',
  devServer : {
    "contentBase" : './adminSettingsArea',
    "hot" : true
  },
  plugins : [
    new webpack.HotModuleReplacementPlugin(),
    new dotenvWebpack()
  ],
  module : {
    rules : [
      {
        test : /\.(js|jsx)$/,
        exclude : [/node_modules/, /vendor/],
        use : {
          loader : "babel-loader",
          options : {
            presets : [
              '@babel/preset-env',
              "@babel/preset-react"
            ]
          },
        }
      }
    ],
  },
};
...