Skip to content

style-loader css-loader error #471

Description

@oliverschenk

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?

Activity

  1. oliverschenk commented on Mar 25, 2016

    @oliverschenk
    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.

  2. PatrickJS commented on Mar 27, 2016

    @PatrickJS
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions