如下图所示:
我本地启用SSR后,服务器端返回渲染好的源代码里,每个cx-page-layout标签都是空的:
![](https://img.laitimes.com/img/__Qf2AjLwojIjJCLyojI0JCLicmbw5CO5UzNkJmNwADM0MTMhNTYxcjM0YDOxIWO3UWM0EjM58CX5d2bs92Yl1iclB3bsVmdlR2LcNWaw9CXt92Yu4GZjlGbh5yYjV3Lc9CX6MHc0RHaiojIsJye.png)
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