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

style-loader css-loader error #471

Closed
oliverschenk opened this issue Mar 25, 2016 · 2 comments
Closed

style-loader css-loader error #471

oliverschenk opened this issue Mar 25, 2016 · 2 comments

Comments

@oliverschenk
Copy link

I did the following:

git clone https://github.com/AngularClass/angular2-webpack-starter.git

cd angular2-webpack-starter

npm install

This works fine.

I then change the following line in webpack config:

{test: /\.css$/, loader: 'raw-loader'},

to

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

and now I get the following error:

EXCEPTION: Error: Uncaught (in promise): TypeError: s.replace is not a function

Ripping my hair out for a few hours now. Google isn't helping as nothing seems to indicate that style-loader or css-loader have any such issues previously. I just don't understand what the problem is?

The reason I wanted to do this is because I'm using Semantic UI and the CSS file only seems to work with these settings. I had it working in the past, but now it no longer does and I'm puzzled. Anyone have Semantic UI working with this project?

@oliverschenk
Copy link
Author

It looks like in order to fix this I had to remove the following line in 'src/app/home/home.ts':

styles: [ require('./home.css') ],

I don't understand why.

@PatrickJS
Copy link
Owner

that's because you changed the loader from raw to styles/css the codebase assumed that .css produced raw css as a string.

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

2 participants