babel / babel/babel-loader

Error: The loaded module contains errors

Open
#912 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
4.8k
Forks
456
Avg merge
9h 19m
Merged PRs (30d)
2

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), :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), :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"
},
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported error with the shown webpack.config and package.json dependencies. Trace the failure from node_modules/webpack/lib/dependencies/LoaderPlugin.js:110 through Compilation.js and compare the loader configuration with the installed Babel and TypeScript packages. Done should be a confirmed cause with a minimal reproduction or actionable diagnosis.

Written by the indexing model from the issue text.

Assessment

Tech stack
babel, javascript, typescript, webpack
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.