- SAP Spartacus 服务器端渲染找不到 index 视图
- SAP Spartacus UI 服务器端渲染的调试启动方式 -
- SAP Spartacus 服务器端渲染单步调试步骤之二:在服务
- 关于 SAP UI5 对服务器端渲染 Server Sider
- SAP Spartacus 找不到登录入口的问题 - 如何使用
- 让 fork 出来的 Github 仓库从远端仓库拖取最新的修改
- SAP 电商云 Accelerator 和 Spartacus
- SAP Spartacus页面css类的赋值逻辑
- SAP Spartacus Definition of Done
- 借助 SAP 电商云 Spartacus UI 提供的 Sche
我基于 SAP Spartacus 源代码级别 4.0 版本进行 SSR 调试时,遇到如下错误:在 dist/storefrontapp 文件夹下面,找不到 index 视图:
Error: Failed to lookup view "index" in views directory "C:\Code\SPA\spartacus\dist\storefrontapp"
at Function.render (C:\Code\SPA\spartacus\dist\storefrontapp-server\main.js:184430:17) [<root>]
at ServerResponse.render (C:\Code\SPA\spartacus\dist\storefrontapp-server\main.js:186292:7) [<root>]
at C:\Code\SPA\spartacus\dist\storefrontapp-server\main.js:315912:13 [<root>]
at Layer.handle [as handle_request] (C:\Code\SPA\spartacus\dist\storefrontapp-server\main.js:187201:5) [<root>]
at next (C:\Code\SPA\spartacus\dist\storefrontapp-server\main.js:187435:13) [<root>]
at Route.dispatch (C:\Code\SPA\spartacus\dist\storefrontapp-server\main.js:187410:3) [<root>]
at Layer.handle [as handle_request] (C:\Code\SPA\spartacus\dist\storefrontapp-server\main.js:187201:5) [<root>]
at C:\Code\SPA\spartacus\dist\storefrontapp-server\main.js:186714:22 [<root>]
at param (C:\Code\SPA\spartacus\dist\storefrontapp-server\main.js:186787:14) [<root>]
at param (C:\Code\SPA\spartacus\dist\storefrontapp-server\main.js:186798:14) [<root>]
at Function.process_params (C:\Code\SPA\spartacus\dist\storefrontapp-server\main.js:186843:3) [<root>]
at next (C:\Code\SPA\spartacus\dist\storefrontapp-server\main.js:186708:10) [<root>]
at expressInit (C:\Code\SPA\spartacus\dist\storefrontapp-server\main.js:184672:5) [<root>]
at Layer.handle [as handle_request] (C:\Code\SPA\spartacus\dist\storefrontapp-server\main.js:187201:5) [<root>]
原因是我忘了首先构建 Storefrontapp,因为即使服务器端渲染时,还是会从 dist 文件夹里读取 index 视图。
因此,首先执行 yarn build,对 storefrontapp 进行构建:
dist/storefrontapp 文件夹下构建出来的 JavaScript 文件动态刷新:
之后问题解决:
更多Jerry的原创文章,尽在:"汪子熙":














网友评论