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

Error load CSS, Module build failed: Unknown word (5:1) #352

Closed
afrianjunior opened this issue Oct 3, 2016 · 26 comments
Closed

Error load CSS, Module build failed: Unknown word (5:1) #352

afrianjunior opened this issue Oct 3, 2016 · 26 comments

Comments

@afrianjunior
Copy link

im trying load css with webpack, but fail to load, message error :

in ./~/css-loader!./~/style-loader!./~/css-loader!./semantic/dist/semantic.css Module build failed: Unknown word (5:1)

style-loader and css-loader 2 does not work?

but my webpack.base.conf.js :

{ test: /\.css$/, loader: 'style!css' }

What should I do? to solve these

im use vue-cli witk webpack template.

thanks before!

@LeoMartinDev
Copy link

Same here

@zhyc9de
Copy link

zhyc9de commented Oct 23, 2016

i don't know why it happened , but i found a solution
don't use css loader , just import your css file

@harwinvoid
Copy link

Same here

@harwinvoid
Copy link

harwinvoid commented Dec 8, 2016

I fixed it by remove { test: /\.css$/, loader: 'style!css' } from webpack.config.js. But i don't know why. anyone could tell me ?

@yinshipeng
Copy link

Same here

@Jacke
Copy link

Jacke commented Dec 19, 2016

same. webpack the most shitty software that I ever seen. It's working by magic and nobody know how to fix it

@mondaychen
Copy link

I had the same issue. I think in generally this error happens when the file is compiled by the css loader for more than once. Check your config to see if there are duplicated css loaders.

@andywer
Copy link

andywer commented Jan 15, 2017

@mondaychen is right. You have probably got more than one loader config containing style-loader and css-loader. If their include/exclude properties allow an intersection (a source file might be matched by both) you might be screwed already... :-/

Guess the only fix is making sure there is no intersection.

@domingohui
Copy link

I saw similar things here #197
But it still doesn't work for me even if I append style! or css!

@rafaelboschini
Copy link

same here ):

@fengyongze
Copy link

same here

@michael-ciniawsky
Copy link
Member

@LeoMartinDev @zhyc9de @harwinvoid @yinshipeng @Jacke @rafaelboschini @fengyongze you guys all using VueJS ? If then please use vue-loader instead. I reopen if my assumption is false 😛

@wnewstar
Copy link

wnewstar commented Jul 3, 2017

@michael-ciniawsky
why need use vue-loader instead? I do it, but have some other question.

@wi-ski
Copy link

wi-ski commented Aug 19, 2017

how do you fix the Bs

@heythanks
Copy link

remove this{ test: /.css$/, loader: 'style!css' } has no error,but css file can't effect this website

@vikashpisces
Copy link

@afrianjunior It worked for me after I changed the order of loaders from require('!css-loader!style-loader!./styles.css'); to require('!style-loader!css-loader!./styles.css');

@tiserge2
Copy link

tiserge2 commented Oct 5, 2017

@vikashpisces thanks guys! it works fine for me after doing it as you said

@codeaimh
Copy link

guys how I know if I have a duplicated loader?

@ghost
Copy link

ghost commented Jan 12, 2018

same here But I solve this shit with using loader:'css-loader!style-loader'
Blv me Don't Use 'use' instead u can use 'loader' which is the keyword of the prev version of the weback and I think it's better than 'use'
I think it's because the css and style loader are not updated ...

@buddyackerman
Copy link

None of the above work. I'm using Angular 5 and have ejected the project from the cli so that I can modify the webpack config.

Here's the entry section:

"entry": {
  "main": [
    "./src\\main.ts"
  ],
  "polyfills": [
    "./src\\polyfills.ts"
  ],
  "styles": [
    "./src/ui-styles.js"
  ]

and here's the module definition:

{
  "test": /\.css$/,
  "loader": 'css-loader!style-loader'
}

I've also tried this:

{
  "test": /\.css$/,
  "loader": ExtractTextPlugin.extract('style-loader!css-loader')
}

They all produce the same error.

@liyanana
Copy link

same here.how to solve??? I cant find the answer.

@atreyhazelhispanic
Copy link

I had this same problem as well as one with scss and sass loader... By default the full npm vue app install is loading css and sass for you. I left only the rule of style-loader on the regex of css and it's perfect!

@SeedyROM
Copy link

SeedyROM commented Jan 4, 2019

@atreyhazelhispanic Could you share some example code for how you solved this?

@yeahhhz
Copy link

yeahhhz commented Jan 15, 2019

Try install a low version loader

@TylerNGUP
Copy link

same here,因为要先加载css-loader,然后才加载style-loader,so must write like this : loader='style-loader!css-loader', after 2.0,must add 后缀,-loader。

@pangjunpeng
Copy link

same here,因为要先加载css-loader,然后才加载style-loader,so must write like this : loader='style-loader!css-loader', after 2.0,must add 后缀,-loader。

oh! your english is very well👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests