Comments (11)
For some reason it's loading style-loader
-processed assets instead of the uproccessed ones.
Dunno.
Honestly I haven't been supporting this project too much for a while now.
Consider universal-webpack
maybe, or there's a ton of other SSR alternatives.
from webpack-isomorphic-tools.
@hrasekh Did you solve this problem?
from webpack-isomorphic-tools.
@skywickenden No, I still get the error, and I could not figure it out what's the problem
from webpack-isomorphic-tools.
Are you using style-loader
inside ExtractTextPlugin
?
If yes then remove it from there.
webpack-contrib/extract-text-webpack-plugin#503 (comment)
from webpack-isomorphic-tools.
In Webpack config:
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var WebpackIsomorphicToolsPlugin = require('webpack-isomorphic-tools/plugin');
var webpackIsomorphicToolsPlugin = new WebpackIsomorphicToolsPlugin(require('./webpack-isomorphic-tools'));
{ test: /\.less$/, use: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader?modules&importLoaders=2&sourceMap!autoprefixer-loader?browsers=last 2 version!less-loader?outputStyle=expanded&sourceMap=true&sourceMapContents=true' }) },
{ test: /\.scss$/, use: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader?modules&importLoaders=2&sourceMap!autoprefixer-loader?browsers=last 2 version!sass-loader?outputStyle=expanded&sourceMap=true&sourceMapContents=true' }) },
In font Awesome config
const ExtractTextPlugin = require('extract-text-webpack-plugin');
fontAwesomeConfig.styleLoader = ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader!less-loader' });
fontAwesomeConfig.styleLoader = buildExtractStylesLoader(ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'less-loader'],
}));
In Bootstrap Config:
const ExtractTextPlugin = require('extract-text-webpack-plugin');
bootstrapConfig.styleLoader = ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader!sass-loader' });
from webpack-isomorphic-tools.
I've just solved that error by using isomorphic-style-loader instead of style-loader. Still working on other errors though, so not sure if it is a complete solution
from webpack-isomorphic-tools.
@hrasekh Don't know, your ExtractTextPlugin config looks ok.
Perhaps you could try commenting-out all require()
s in your code and uncommenting them one-by-one to find which one is causing the error.
Other than that, don't know what could be causing the issue - webpack configs are extremely complicated with lots of moving parts inside them and each project has their own home-made webpack config.
from webpack-isomorphic-tools.
@skywickenden perhaps...
The issue seems to be that assets loaded using style-loader
are being require()
d on the server side.
While webpack-isomorphic-tools
does workaround that by excluding style-loader
ed assets and require()
ing just the text CSS instead (before it goes through style-loader
) it may not work in some specific scenario: the require()
workaround has been tested for simple configs like style-loader!css-loader!...
and there is a possibility that for a more complex webpack config it could break.
I myself migrated my project to universal-webpack
a long time ago and I think webpack-isomorphic-tools
is a messy solution: it was OK when the whole thing started but turned out to be very hacky.
from webpack-isomorphic-tools.
Updated the readme:
webpack-isomorphic-tools
is a small helper module providing very basic support for isomorphic (universal) rendering when using Webpack. It was created a long time ago when Webpack was v1
and the whole movement was just starting. Therefore webpack-isomorphic-tools
is a hacky solution. It allowed many projects to set up basic isomorphic (universal) rendering in the early days but is now considered deprecated and new projects shouldn't use it. This library can still be found in legacy projects. For new projects use either universal-webpack
or all-in-one frameworks like Next.js.
from webpack-isomorphic-tools.
I'm working on one of those legacy projects. Just trying to update some packages, but is turning into a bit of Gordian knot.
next.js looks good, but it would take a couple of months to refactor the whole project to use it! I'll just have to keep plugging away at the errors.
from webpack-isomorphic-tools.
from webpack-isomorphic-tools.
Related Issues (20)
- Seems like my webpack.config.js file is getting ignored HOT 1
- Error while wepback build HOT 2
- Is it possible to have _style property in production using ExtractTextPlugin loader HOT 2
- webpack_asset_path is not defined HOT 3
- Keep getting errors module not defined and exports not defined HOT 9
- Ability to ignore warnings / errors HOT 6
- Ability to specify publicPath at runtime for server-side? HOT 1
- Inside CSS, background-url is packaged into absolute paths HOT 1
- Support for compression webpack plugin (js.gz) HOT 1
- Resolving webpack custom module paths HOT 1
- SyntaxError: Unexpected token < (skipping require call, fallback to original loader) HOT 5
- Depreciation for webpack 4x HOT 2
- Clarification in README HOT 2
- mini-css-extract-plugin HOT 1
- anyway to define __webpack_public_path__ or cdn? HOT 15
- Webpack resolve extensions not working with SSR
- Babel 7 is not supported HOT 4
- (/config/webpack-assets.json not found) HOT 1
- Unexpected token less file HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webpack-isomorphic-tools.