Cannot find module node_modules/babel-loader/lib/index.js?cacheDirectory
- Dominant language
- JavaScript
- Stars
- 4.8k
- Forks
- 456
- Avg merge
- 9h 19m
- Merged PRs (30d)
- 2
Description
**I'm submitting a bug report**
**Webpack Version:**
"webpack": "^4.20.2"
**Babel Core Version**:
"@babel/core": "^7.0.0"
**Babel Loader Version**:
"babel-loader": "^8.0.0"
**Please tell us about your environment:**
OSX 10.14
webpack config:
```js
new HappyPack({
id: 'jsx',
threads: 4,
loaders: [
{
loader: 'babel-loader?cacheDirectory',
options: require('./babel.config'),
exclude: ['/node_modules/']
}
]
}),
```
Error Image:

Node_modules folder have `babel-loader`, when I remove cacheDirectory option, it's ok,
Contributor guide
Research direction
Use the webpack configuration shown in the report as the reproduction entry point. Run the setup with `babel-loader?cacheDirectory` and then without that option, confirming the module-resolution error and recording the listed webpack, @babel/core, babel-loader, and HappyPack versions. Done means the cacheDirectory form works with this configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, webpack
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100