Module build failed: ReferenceError: window is not defined #503
Comments
- { test: /\.css$/, use: ExtractTextPlugin.extract({ fallback: 'style-loader', use: ['style-loader', 'css-loader'] }) },
+ { test: /\.css$/, use: ExtractTextPlugin.extract({ fallback: 'style-loader', use: [ 'css-loader' ] }) }, Remove |
@michael-ciniawsky maybe we can throw error if somebody try to use |
yep 😛, seems like it's needed, folks don't read the docs :D |
seems i missed it thanks for the help. |
Thanks, also got bit by this. Probably confusion is coming from a config not using extract-text then moving to it, it's not clear that |
Can someone explain why removing style-loader from the list of loaders and having that in fallback alone does the trick? |
@sbadri2001 Acc to documentation:
& this is what ExtractTextWebpackPlugin do:
You'll probably never need to do both at one place but it's great to have inlining as a fallback to when ExtractTextWebpackPlugin fails. |
Just gonna let that here, faced the same problem, finally after trying different solutions, what worked for me was just removing the fallback
|
@michael-ciniawsky it's ok,but my style is scss, convert css don't work.
my app.js is convert bundle.js
|
For people using Vue, |
* 공통 메인 라우터 작업 삽질기 1. 라우팅 전 공통 처리기 _app 작업중 게속 안되서 이상하니 APP, Container 컴포넌트가 next 버전 차이였는지 모듈이 없었음. 다시 latest 버전 설치하니 정상 작동 2. with-redux 등 게속 안되서 example 에서의 실 소스로 lib 에 적용하여 알게된건 결국 window 객체가 존재 안하는데 내가작성한 store에서 redux-dev-tool 부분에서 사용한 window 객체가 사용하는것을 확인 3. (2)번에서 지운 내용으로도 안되서 확인 결과 style-loader module 에서 window 에 대한 window is not found 이슈가 존재 하는 부분 확인 후 이부분 처리하니 이상 없음 확인 style-loader 의 대체 방법을 찾아야 한다. --todo style-loader 에 대한 우회 처리 방안 straw-hat-labs/phoenix_assets_webpack#53 webpack-contrib/extract-text-webpack-plugin#503
"extract-text-webpack-plugin": "2.1.0",
my webpack config;
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
getting errors;
any ideas?
The text was updated successfully, but these errors were encountered: