SAP Spartacus 服务器端渲染返回的源代码不全的问题及解决方案
如下圖所示:
我本地啟用SSR后,服務(wù)器端返回渲染好的源代碼里,每個(gè)cx-page-layout標(biāo)簽都是空的:
但是用來(lái)做SSR測(cè)試的服務(wù)器上,返回的是完整的源代碼:
原因:
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
更多Jerry的原創(chuàng)文章,盡在:“汪子熙”:
總結(jié)
以上是生活随笔為你收集整理的SAP Spartacus 服务器端渲染返回的源代码不全的问题及解决方案的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Arm 宣布向美国递交 IPO 申请书,
- 下一篇: SAP UI渲染模式:客户端渲染 VS