我正在尝试使用Angular 6应用程序进行SSR。在花费大量时间设置Angular Universal之后,根据窗口对象,我们遇到了一些节点模块的路障。
我已经遍历了GitHub的建议,并试图在全局范围内创建一个空的window
对象,并尝试在server.js
文件中使用domino窗口。但是模块仍然抱怨缺少window
对象。
```
```node_modules/beaver-logger/dist/beaver-logger.js:697
var global = window.__zalgopromise__ = window.__zalgopromise__ || {
^
ReferenceError: window is not defined
at Object.defineProperty.value (/home/user/code/sd/angular-frontend/node_modules/beaver-logger/dist/beaver-logger.js:697:15)
at __webpack_require__ (/home/user/code/sd/angular-frontend/node_modules/beaver-logger/dist/beaver-logger.js:30:30)
at Object.defineProperty.value (/home/user/code/sd/angular-frontend/node_modules/beaver-logger/dist/beaver-logger.js:669:17)
at __webpack_require__ (/home/user/code/sd/angular-frontend/node_modules/beaver-logger/dist/beaver-logger.js:30:30)
at Object.defineProperty.value (/home/user/code/sd/angular-frontend/node_modules/beaver-logger/dist/beaver-logger.js:499:13)
at __webpack_require__ (/home/user/code/sd/angular-frontend/node_modules/beaver-logger/dist/beaver-logger.js:30:30)
at Object.defineProperty.value (/home/user/code/sd/angular-frontend/node_modules/beaver-logger/dist/beaver-logger.js:175:14)
at __webpack_require__ (/home/user/code/sd/angular-frontend/node_modules/beaver-logger/dist/beaver-logger.js:30:30)
at Object.defineProperty.value (/home/user/code/sd/angular-frontend/node_modules/beaver-logger/dist/beaver-logger.js:91:16)
at __webpack_require__ (/home/user/code/sd/angular-frontend/node_modules/beaver-logger/dist/beaver-logger.js:30:30)```
对我可能缺少的东西有任何想法吗?