-
-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webpack 5 - TypeError: The 'compilation' argument must be an instance of Compilation #631
Comments
You have two versions of webpack, webpack@4 and webpack@5 |
Can you run |
Hi @evilebottnawi, thanks for the quick response!
My application inherits most of its dependencies from our "@blacksky/app" library that we use as a base for most of our webapps. I've got a minimal library going trying to reproduce it locally, but so far it imports scss files just fine. Could it have something to do with the fact that we're deriving our dependencies from a child library? The other thing worth mentioning is that I have an
... so I doubt I've got any kind of weird caching going on 🤔 |
A clue!! When I Something about the fact that it's a dependency of another dependency causes it to misbehave... 🤔 |
Yes, maybe you can provide link, will be great to look at structure |
Looks like MiniExtractCssPlugin works fine as long as I don't I've worked around this issue for now by changing my webpack config to use To clarify: MiniCssExtractPlugin works in both development and production modes as long as I don't |
I get same error, how to resolve |
I'm getting the same error. The object is an instance of a https://stackoverflow.com/a/63576099/437 I don't have a solution yet, but hopefully this helps. |
@alexander-akait I am running into the same issue. Are you still looking for a reproduction? I might be able to get something going if you need it still. |
Yep, let's do it and I will look at this |
There you go: https://github.com/Christian24/mini-css-extract-linking-issue As always: if you need more info, let me know. |
If you disable |
No, the issue remains the same. |
Yep, here interesting limitation/problem, when you use monorepos and have |
Remove |
Yeah, I have had this issue with multiple plugins already. Most of the time I got it fixed by using the same versions of webpack/webpack-cli. Interestingly, in webpack@4 this worked fine. Sadly, we are using Git Submodules (imagine login folder in my example would be its own repository), we check it out in during continous integration (like Jenkins). So, we need both both |
There is not webpack problems/bugs, this is how More simple, when you have |
You can solve it using |
I understand. A few things come to my mind right now:
|
Some of the approaches will work, hard to say what is better, because it depends what you need, many developers uses
Yes too, you can create helper function like
Will work
Because some plugins require |
First of all, thanks a lot for the explanation.
I am not exactly sure I understand what you mean here. Would you have something similar to module.exports = function() {
return [loginConfig, adminConfig]
} in I would very much apreciate if the error message specifically mention having multiple instances of |
You mean you need to require
Already talking about it |
@Christian24 found solution, how we can solve it, so just wait the next patch release |
Cool :) |
#698, still WIP, it is not easy, hope I will finish it today/tomorrow |
Don't worry. I have to focus on other stuff at the moment anyway, so it will probably be a couple days or weeks until I get back to this. |
Fixed, release will be today, should fix all problems with compatibility |
Hello everybody! Still have this issue when using Webpack 5 and Next.js. My package.json deps section:
Webpack config that causes this error:
I cannot remove the webpack from the dependencies - after that, both If I install the 4th webpack everything works fine, but we have a goal to update the webpack... but because of this error, the |
Expected Behavior
.scss
files.scss
files are transformed to css and output in dist directoryActual Behavior
MiniCssExtractPlugin.loader
results in webpack errors for every.scss
file:MiniCssExtractPlugin.loader
with'style-loader'
yields no errors and styles the application as intended, but css is not extracted (obviously). This leads me to suspect the issue has something to do with this plugin 🤔Code
Versions:
Results in errors:
No errors, no extract:
Is there anything obvious from this configuration that could yield errors with the
compilation
argument? Has anybody seen this before? I'm working on creating a small repo to reproduce the issue, but if you see a stupid mistake in here or have clarifying questions for me, please ask right away!Thanks very much for your help! 👍
The text was updated successfully, but these errors were encountered: