Description
error
[webpack-cli] Error: The loaded module contains errors at /Users/wangwei/Desktop/diagnose/node_modules/webpack/lib/dependencies/LoaderPlugin.js:110:11 at /Users/wangwei/Desktop/diagnose/node_modules/webpack/lib/Compilation.js:1671:8 at /Users/wangwei/Desktop/diagnose/node_modules/webpack/lib/util/AsyncQueue.js:352:5 at Hook.eval [as callAsync] (eval at create (/Users/wangwei/Desktop/diagnose/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:4:1) at AsyncQueue._handleResult (/Users/wangwei/Desktop/diagnose/node_modules/webpack/lib/util/AsyncQueue.js:322:21) at /Users/wangwei/Desktop/diagnose/node_modules/webpack/lib/util/AsyncQueue.js:305:11 at /Users/wangwei/Desktop/diagnose/node_modules/webpack/lib/Compilation.js:1343:15 at /Users/wangwei/Desktop/diagnose/node_modules/webpack/lib/HookWebpackError.js:68:3 at Hook.eval [as callAsync] (eval at create (/Users/wangwei/Desktop/diagnose/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:13:1) at Cache.store (/Users/wangwei/Desktop/diagnose/node_modules/webpack/lib/Cache.js:107:20)
webpack.config
{
test: /\.(js|ts|tsx)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: [
['@babel/preset-react'],
['@babel/preset-env', { targets: "defaults" }]
],
plugins: ['@babel/plugin-proposal-class-properties']
}
}
}
package.json
"devDependencies": {
"@babel/core": "^7.14.6",
"@babel/plugin-proposal-class-properties": "^7.14.5",
"@babel/preset-env": "^7.14.7",
"@babel/preset-react": "^7.14.5",
"@types/chrome": "0.0.146",
"@types/react": "^17.0.14",
"@types/react-dom": "^17.0.9",
"@types/ua-parser-js": "^0.7.36",
"babel-loader": "^8.2.2",
"clean-webpack-plugin": "^4.0.0-alpha.0",
"copy-webpack-plugin": "^9.0.1",
"css-loader": "^5.2.6",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.3.2",
"mini-css-extract-plugin": "^2.1.0",
"ts-loader": "^9.2.3",
"typescript": "^4.3.5",
"url-loader": "^4.1.1",
"webpack": "^5.42.1",
"webpack-cli": "^4.7.2",
"webpack-dev-server": "^3.11.2"
},