-
Notifications
You must be signed in to change notification settings - Fork 238
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
使用mini-css-extract-plugin服务端报错document is not defined #196
Comments
I also encounter the same problem. How to solve it is good? Online wait |
Here is the the successful solution of the same problem: Akryum/vue-cli-plugin-ssr@806418e |
This is very actual problem |
已经找到解决办法了: use null-loader |
请问你解决了吗? |
I met another problem with mini-css-extract-plugin. See this comment Do you guys have any solutions? |
我参考了 Akryum/vue-cli-plugin-ssr@806418e,但会出现另一个问题,如果异步引入的 |
I found solution from this comment Use
|
和 style-loader 冲突 去掉 style-loader 即可 |
请问有具体代码么 |
我使用第三方css也会报错 |
Met samilar situation , use null-loader solve my problem. {
test: /\.scss$/,
use: [
'null-loader'
]
} At first I use vue-style-loader in webpack.server.config,the error was gone. But cause a new problem, the css rule duplicated. |
use jsdom can be work。 npm install jsdom --save // in server.js /* 模拟window对象逻辑 */ global.window = dom.window |
I encountered this problem as well. And I found out that it is because I forgot to delete the 'style-loader' reference. |
I create a vue-ssr-demo project with vue-cli, and I also encountered the same problem. My solution is replace the mini-css-extract-plugin with a new loader. You can refer to it. |
最近使用 webpack 4 配置 ssr 环境,发现一个奇怪的问题:
当使用 mini-css-extract-plugin 这个插件的时候,如果 在 vue-router 中配置 动态加载的形式
那么只要在其中人一个.vue文件中中写 css 样式,那么在访问页面的时候就会报错:document is not defined
打开 vue-ssr-server-bundle.json 文件发现 有很多地方使用了 document
于是 就尝试着换回 [email protected],但是又出现,打包的时候会生成一个 manifest 的空 css 文件,不知如何解决。
我使用的是自己配置的环境,地址在 https://github.com/Maxlasting/vue-ssr-template
请问,能否给一个 基于 webpack 4 的 ssr 示例,或者帮我解决一下上面的问题,非常感谢。
The text was updated successfully, but these errors were encountered: