-
Notifications
You must be signed in to change notification settings - Fork 18
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
使用normalize.css
时服务端渲染会报错
#15
Comments
这里还有个新的问题,如果去掉 2020-03-11 17:56:53,392 ERROR 55180 [admin/home.js] server render bundle error, try client render, the server render error ReferenceError: document is not defined
at eval (webpack:///./node_modules/vue-echarts/dist/vue-echarts.js?:1:11870)
at eval (webpack:///./node_modules/vue-echarts/dist/vue-echarts.js?:1:37)
at eval (webpack:///./node_modules/vue-echarts/dist/vue-echarts.js?:1:138)
at Object../node_modules/vue-echarts/dist/vue-echarts.js (__vue_ssr_bundle__:2697:1)
at __webpack_require__ (__vue_ssr_bundle__:20:30)
at eval (webpack:///./app/web/component/common/echart/index.ts?./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/thread-loader/dist/cjs.js??ref--0-1!./node_modules/ts-loader??ref--0-2:6:86)
at Module../node_modules/cache-loader/dist/cjs.js?!./node_modules/thread-loader/dist/cjs.js?!./node_modules/ts-loader/index.js?!./app/web/component/common/echart/index.ts?vue&type=script&lang=ts& (__vue_ssr_bundle__:1391:1)
at __webpack_require__ (__vue_ssr_bundle__:20:30)
at eval (webpack:///./app/web/component/common/echart/index.ts?:2:225)
at Module../app/web/component/common/echart/index.ts?vue&type=script&lang=ts& (__vue_ssr_bundle__:227:1) 这里看似是 vue-echarts 导致的 因为 vue-echarts的文档中指出 webpack 环境下默认提供的是源码版本,所以需要配置babel处理 但是来到 所以我在引入的时候是这样引用的 import ECharts from 'vue-echarts/dist/vue-echarts'; 虽然客户端渲染能跑通但是服务端渲染会报错 |
@funkyLover 从错误看,vue-echarts 不支持 ssr , 具体解决方案 https://www.yuque.com/easy-team/blog/lcbfwb |
@hubcarl 感谢,那第一个问题方便帮忙看下吗 import 'normalize.css'; |
直接在 .vue 页面里面 import 'normalize.css' 试试 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: