-
Notifications
You must be signed in to change notification settings - Fork 144
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
TypeError: style._getCss is not a function #153
Comments
Maybe problem in your webpack.config, or if you don't use webpack to generate ssr bundle. |
@frenzzy const webpackConfig:any = require('../config/webpack.config')(process.env.NODE_ENV)
webpackConfig['entry'][0] = `webpack-hot-middleware/client?path=/__webpack_hmr&timeout=20000&reload=true`
// isomorphic-style-loader
webpackConfig.module.rules[2].oneOf.forEach((rule:any) => {
if(Object.prototype.toString.call(rule.test) === '[object RegExp]' && rule.test.test('.css') ) {
rule.use[0] = 'isomorphic-style-loader'
}
});
const compiler:any = webpack(webpackConfig)
app.use(hotMiddleware(compiler))
app.use(devMiddleware(compiler, {
noInfo: true,
quiet: false,
stats: {
colors: true
}
})) is it because i use |
I think it's a good idea for you to try providing minimum reproduction code instead of your code. If |
I use
koa
forreact
ssr
when I use
css-modules-require-hook
andimport style from './styles'
, the variable is thisand then, i try to use
isomorphic-style-loader
order by the latest doc,but it's also errorrender.ts
App.tsx
and the
style
variable is an empty objectThe text was updated successfully, but these errors were encountered: