babel / babel/babel-loader

Cannot find module node_modules/babel-loader/lib/index.js?cacheDirectory

Open
#691 8 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

**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:

![image](https://user-images.githubusercontent.com/14831261/46131623-b98cbe80-c26e-11e8-8ecd-19e3ff402cd1.png)

Node_modules folder have `babel-loader`, when I remove cacheDirectory option, it's ok,

Contributor guide

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.