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

Unable import CSS files with latest code #111

Closed
adityaparab opened this issue Aug 14, 2016 · 3 comments
Closed

Unable import CSS files with latest code #111

adityaparab opened this issue Aug 14, 2016 · 3 comments

Comments

@adityaparab
Copy link

Hi,

I have been using this starter template for a while now and I love it. Today I started a new project and I with latest changes I am unable to import css files the way I used to.

I'm getting this error

ERROR in ./src/index.css
Module parse failed: D:\Aditya\FCC\React\Calculator\src\index.css Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (1:0)
    at Parser.pp$4.raise (D:\Aditya\FCC\React\Calculator\node_modules\acorn\dist\acorn.js:2221:15)
    at Parser.pp.unexpected (D:\Aditya\FCC\React\Calculator\node_modules\acorn\dist\acorn.js:603:10)
    at Parser.pp$3.parseExprAtom (D:\Aditya\FCC\React\Calculator\node_modules\acorn\dist\acorn.js:1822:12)
    at Parser.pp$3.parseExprSubscripts (D:\Aditya\FCC\React\Calculator\node_modules\acorn\dist\acorn.js:1715:21)
    at Parser.pp$3.parseMaybeUnary (D:\Aditya\FCC\React\Calculator\node_modules\acorn\dist\acorn.js:1692:19)
    at Parser.pp$3.parseExprOps (D:\Aditya\FCC\React\Calculator\node_modules\acorn\dist\acorn.js:1637:21)
    at Parser.pp$3.parseMaybeConditional (D:\Aditya\FCC\React\Calculator\node_modules\acorn\dist\acorn.js:1620:21)
    at Parser.pp$3.parseMaybeAssign (D:\Aditya\FCC\React\Calculator\node_modules\acorn\dist\acorn.js:1597:21)
    at Parser.pp$3.parseExpression (D:\Aditya\FCC\React\Calculator\node_modules\acorn\dist\acorn.js:1573:21)
    at Parser.pp$1.parseStatement (D:\Aditya\FCC\React\Calculator\node_modules\acorn\dist\acorn.js:727:47)
    at Parser.pp$1.parseTopLevel (D:\Aditya\FCC\React\Calculator\node_modules\acorn\dist\acorn.js:638:25)
    at Parser.parse (D:\Aditya\FCC\React\Calculator\node_modules\acorn\dist\acorn.js:516:17)
    at Object.parse (D:\Aditya\FCC\React\Calculator\node_modules\acorn\dist\acorn.js:3098:39)
    at Parser.parse (D:\Aditya\FCC\React\Calculator\node_modules\webpack\lib\Parser.js:902:15)
    at DependenciesBlock.<anonymous> (D:\Aditya\FCC\React\Calculator\node_modules\webpack\lib\NormalModule.js:104:16)
    at DependenciesBlock.onModuleBuild (D:\Aditya\FCC\React\Calculator\node_modules\webpack-core\lib\NormalModuleMixin.js:310:10)
 @ ./src/index.jsx 7:13-35

I see that correct css loaders are pushed in the loaders array but I still get this error.

I am, however, able to import CSS files using fundamental webpack style like

import styles from 'style!css!./index.css';

instead of

import styles from './index.css';

Although it would be cool if I don't have to apply the loaders everytime I import css.

Wondering if this is specifically an issue with my setup or what.

@alicoding
Copy link
Collaborator

@k3a do you mind taking a look into this?

@k3a
Copy link
Contributor

k3a commented Aug 14, 2016

Of course! This is win-only problem :) will fix in a second

@alicoding
Copy link
Collaborator

@adityaparab let me know if latest fixes your issue. Thanks for filing and thanks @k3a for the fix!

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

3 participants