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

webpack odd behavior (nothing literally happens - probably stalls) #213

Closed
shiroganee opened this issue Feb 1, 2016 · 2 comments
Closed

Comments

@shiroganee
Copy link

Well I've been reading issues over here and I believe it is the same case as mentioned in few places here and there. that's similar to #100
Anyway how does it look in my project.

Whenever I try to import anything scss related - it stops working -
image

If I will add it manually during HRM then it works. (First I start application without import, later on I add that import to file and it works (and show what I uploaded below))
image

I'm quite a newbie to Webpack though so maybe I'm doing something absolutely wrong.

and 4 commands that i'm using currently

"clean": "rimraf dist",
    "build:webpack": "webpack --config webpack.config.prod.js  --progress --colors",
    "build": "npm run clean && npm run build:webpack",
    "start": "npm run clean && npm run build:webpack && node server.js",

@shiroganee shiroganee changed the title webpack odd behavior (nothing literally happens) webpack odd behavior (nothing literally happens - probablhy stalls) Feb 1, 2016
@shiroganee shiroganee changed the title webpack odd behavior (nothing literally happens - probablhy stalls) webpack odd behavior (nothing literally happens - probably stalls) Feb 1, 2016
@shiroganee
Copy link
Author

Ok I solved it by myself. The problem wasn't with the sass-loader nor with the webpack (sorry). It was all about
typeof window !== 'undefined.
I'm writing isomorphic app and the webpack nor the sass-loader was crashing. The crashing one was application during start. Odd thing that WebStorm didn't show that. I only observed that in Visual Studio Code (unexpected token in scss file).

if (typeof window !== 'undefined')
and require in that resolved problem and it is working like a charm right now.

Maybe it is worth pointing out in Readme that in isomorphic apps it is important to check for window if you wish to include styles?

@jhnns
Copy link
Member

jhnns commented Jun 26, 2016

Thx for also writing down the solution for your case. I don't think that we should add a note on isomorphic apps since this is not related to the sass-loader at all.

@jhnns jhnns closed this as completed Jun 26, 2016
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