-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Error: No module factory available for dependency type: CssDependency #5043
Comments
I believe this is due to the In the default config, the plugin version depended by If you aimed to modify the plugin option, you don't need to add a |
As of the linked issue, as it happened on a new project, it's more likely to be a path casing issue. See #5022 (comment) |
Thank you for the help.
This was the case I have updated the dependency accordingly and now |
Receiving this on a new project. Tried to create several new projects, and none of them can build with vue cli v4.1.2. What is the solution? |
解决方案: |
I only found success with v0.8.0 of mini-css-extract-plugin, when used with vue-cli-service (v0.9.0, v0.8.2, and v0.8.1 resulted in the same CssDependency error message). I pinned the version via the following package.json entry:
|
Not sure if I'll have to use the plugin eventually. Reading through similar issues I tried running build command in powershell and it just worked. Guessing it resolves the casing properly. This issue for me is in using bash shell for windows which I would like to be able to continue using if anyone has a fix for that. |
Even me also getting the same as of now |
I got this error on a brand new project created by the cli and was able to get around it by using |
I can confirm solution from @akiander works, although this totally puzzles me why? I'd be thankful if someone can tell me why the difference? |
Funny, I ended back here again. 6 months later.... Newish project, finally making a production build after a few hundred hours, doesn't build with vue cli :| |
@sodatea Why is this closed? Seems to be an ongoing problem that is often no fault of the user since it affects new projects with vanilla configs? Vue CLI seems to insist that the path is upper case, but the actual path is lower case, where can this be changed? vs |
I have same problems. |
I met this error, and bypass it by double checking the path of my running dictionary. |
I managed to fix the issue by going to the homescreen, removing the offending project from the list. And then importing the same folder containing the project (make sure the casing is correct, if not, switch to the parent directory first and then select the project folder again). |
This is a path casing issue. If you start Visual Studio Code using a path with incorrect case (eg by executing code . from cmd/PowerShell) or you run a build script from PowerShell when the path you are executing from is incorrect case then you will get this problem. I created the following powershell script to get the correct casing for the current path: function Get-CaseSensitivePath {
} |
@mekatrol How we should use your script to find problematic paths? |
So, in my case error occuring, when I starting |
Visual Studio Code is not the issue, npm packages are the issue, code doesn't care about the case but it does pass the incorrect case straight through to npm. I use the function like: Start in some root project folder (this is my base project folder which includes vue js and .net core sub folders)This gets the current directory with case corrected$pwd = Get-CaseSensitivePath (Resolve-Path -Path ./).Path Save current locationPush-Location change to my vue js project (using the correct case $pwd variable)cd "$pwd[vue project directory]" run my build (in this case $build mode is set to prod)npm run "build_$buildMode" Restore to original locationPop-Location |
I only have this problem when I build on my Windows virtual machine. Everything builds fine on my Mac. Building with npx (instead of npm run or yarn) resolves the issue. It's annoying to have to remember to use a different command when I build for Windows (I'm building an Electron app so have to build directly on the platform), but it works. The worst part was that, when I built the electron app & it failed, I got zero debugging info. I couldn't even figure out what to search for to get me to this page and the solution until I spent ~3 days putting together different setups and trying to build. When I did just vue/vuetify and added css to the page, I finally got usable debugging info that led me here. However, it did work with the electron/vue/vuetify project, so I'm quite satisfied. |
@zdm thank you! Using correct cases in cd /Path/to/SoUrCe solved this totally unintelligible error for me |
Version
4.1.2
Reproduction link
https://github.com/imran-iq/cssdependancy-poc
Environment info
Steps to reproduce
clone repo, run
yarn install
thenyarn build
What is expected?
No errors
What is actually happening?
Get a CssDependency error
Not sure if this is a vue issue or a https://github.com/webpack-contrib/mini-css-extract-plugin issue, but since this issue was filed: #5030 which produced an similar error message, I would post here.
This was not an issue with
mini-css-extract-plugin
at 0.8.2, but after a dependabot update project no longer buildsThe text was updated successfully, but these errors were encountered: