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

Had to add css loader prefix in app.jsx to successfully complete webpack process #197

Closed
ilazarte opened this issue Nov 10, 2016 · 7 comments

Comments

@ilazarte
Copy link

from:
import 'bootstrap/dist/css/bootstrap.min.css';

to:
import 'css!../node_modules/bootstrap/dist/css/bootstrap.min.css';

otherwise works great, thanks.

@alicoding
Copy link
Collaborator

Hi,

Do you mind create a pull request with the fix?

Thanks!

@shershen08
Copy link

Even with the plugin prefix does not work for me. Took a fresh cloned repo, then npm install and and installed only bootstrap ( npm i bootstrap --save)
Added this to the component like so

import styles from './index.scss';
import React from 'react';
import 'css!../node_modules/bootstrap/dist/css/bootstrap.css';

export default class App extends React.Component {
  render() {
    return (
      <div>

After npm start I get the following

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

  3 | // load the styles
  4 | var content = require("!!./../../../css-loader/index.js!./bootstrap.css");

screen shot 2016-12-03 at 19 22 19

@alicoding
Copy link
Collaborator

There seem to be a bug in css-loader module itself... I saw this webpack-contrib/css-loader#362 issue and using import 'style!../node_modules/bootstrap/dist/css/bootstrap.css'; instead of css prefix works.

@alicoding
Copy link
Collaborator

Closing this unless we can do anything to make this better...

@wzup
Copy link

wzup commented Jan 30, 2017

I have similar issue:

ERROR in ./~/css-loader!./assets/sass/foo.css
Module build failed: Unknown word (1:1)

> 1 | exports = module.exports = require("./../../node_modules/css-loader/lib/css-base.js")();
    | ^
  2 | // imports
  3 |
  4 |

Syntax Error: Unknown word (1:1)

> 1 | exports = module.exports = require("./../../node_modules/css-loader/lib/css-base.js")();
    | ^
  2 | // imports
  3 |
  4 |

    at C:\Users\user\app\node_modules\css-loader\lib\processCss.js:219:23
    at process._tickCallback (internal/process/next_tick.js:103:7)
 @ ./assets/js/react/dev/MyCustomSlider.js 47:0-22

@alicoding
Copy link
Collaborator

sadly css-loader hasn't fixed their issue yet :(

@gulshanzealous
Copy link

I had the same error. css-loader is not working. Replaced and style-loader worked instantly. The following works :
import "style-loader!../styles/main.css";

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

5 participants