前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >SAP Spartacus 服务器端渲染返回的源代码不全的问题及解决方案

SAP Spartacus 服务器端渲染返回的源代码不全的问题及解决方案

作者头像
Jerry Wang
发布2021-02-24 10:09:17
2600
发布2021-02-24 10:09:17
举报

如下图所示:

我本地启用SSR后,服务器端返回渲染好的源代码里,每个cx-page-layout标签都是空的:

但是用来做SSR测试的服务器上,返回的是完整的源代码:

原因:

Additionally, it looks like you might have an invalid certificate on the back-end, which causes the angular SSR render to pass (therefore you see the regular non-CMS angular components being rendered), but you won’t see Spartacus’ CMS components being rendered.To go around this in development, you can first install “cross-env” package, and then run “cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 node dist/storefrontapp-server/main.js”.After doing all this, you should be able to see the more sensible response.

解决方案:

cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 node dist/storefrontapp-server/main.js

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2021-01-22 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
SSL 证书
腾讯云 SSL 证书(SSL Certificates)为您提供 SSL 证书的申请、管理、部署等服务,为您提供一站式 HTTPS 解决方案。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档