Skip to content
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

css-loader 4.x.x support? #46

Closed
Sombian opened this issue Aug 1, 2020 · 8 comments · Fixed by #47
Closed

css-loader 4.x.x support? #46

Sombian opened this issue Aug 1, 2020 · 8 comments · Fixed by #47

Comments

@Sombian
Copy link

Sombian commented Aug 1, 2020

vue-loader stopped working after upgrade css-loader to 4.x.x from 3.6.0.
i see some breaking changes documented on css-loader repo.
please fix this.

@huangkaiqiao
Copy link

huangkaiqiao commented Aug 4, 2020

I have encountered the same problem as you do.
i can't find out what's wrong with webpack.config.js of my project
until open this issue.
plz fix this. or change official document of vue-loader.
thanks a lot.

@foxxyz
Copy link

foxxyz commented Aug 7, 2020

@huangkaiqiao for most purposes you can safely swap out vue-style-loader with style-loader and your project should work fine. Also see #42

I will look into what exactly is causing the problem...

Edit: the problem is that css-loader's esModule option is set to true by default in v4. The correct workaround for now is replacing the css-loader declaration in your webpack config with:

{
    loader: 'css-loader',
    options: {
        esModule: false
    }
}

@nofacer
Copy link

nofacer commented Aug 9, 2020

@foxxyz works for me. Thanks a lot.

Awea added a commit to wearemd/spa-starter that referenced this issue Aug 10, 2020
@IAmJulianAcosta
Copy link

Confirmed, @foxxyz solution worked

@privatenumber
Copy link

Minimal reproduction repo for reference: https://github.com/privatenumber/vue-css-loader-bug

@ccnixon
Copy link

ccnixon commented Nov 5, 2020

I was stuck on this issue for days. @foxxyz solution worked for me.

@Otto-J
Copy link

Otto-J commented Feb 22, 2021

耗费了好久时间来排查这个问题。希望更新文档

@p2yang
Copy link

p2yang commented Mar 3, 2021

Thanks. It's ok to use style-loader@2 to replace vue-style-loader.

mrfinch added a commit to codecombat/codecombat that referenced this issue Mar 8, 2022
… added as key in chunkPaths

2.add css-extraction for .css files. This extracts css from vue files and fixes issue caused by css-loader update mentioned here: vuejs/vue-style-loader#46 (comment)
mrfinch added a commit to codecombat/codecombat that referenced this issue Mar 8, 2022
* Revert "Revert "upgrade to node 14 and webpack 5 (#6547)""

This reverts commit 54136df.

* 1. change logic of compile-static-templates to remove undefined being added as key in chunkPaths
2.add css-extraction for .css files. This extracts css from vue files and fixes issue caused by css-loader update mentioned here: vuejs/vue-style-loader#46 (comment)
nwinter pushed a commit to codecombat/codecombat that referenced this issue Apr 22, 2022
* Revert "Revert "upgrade to node 14 and webpack 5 (#6547)""

This reverts commit 54136df.

* 1. change logic of compile-static-templates to remove undefined being added as key in chunkPaths
2.add css-extraction for .css files. This extracts css from vue files and fixes issue caused by css-loader update mentioned here: vuejs/vue-style-loader#46 (comment)
nwinter pushed a commit to codecombat/codecombat that referenced this issue Apr 22, 2022
* upgrade to node 14 and webpack 5

* 1. change logic of compile-static-templates to remove undefined being added as key in chunkPaths
    2.add css-extraction for .css files. This extracts css from vue files and fixes issue caused by css-loader update mentioned here: vuejs/vue-style-loader#46 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
9 participants