Replies: 1 comment
-
found angular/universal#2352 but it got closed |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I am trying to build and run my angular project using SSR but I keep bumping into the issue of document object not existing on the server side. The error seems to come from bootstrap, specifically util/component-functions.js :
EventHandler.on(document, clickEvent,
[data-bs-dismiss="${name}"]
, function (event) {^
ReferenceError: document is not defined
at enableDismissTrigger (/Users/asd/asd/dist/server/vendor.js:3972:19)
at 46788 (/Users/asd/asd/dist/server/vendor.js:4053:1)
at webpack_require (/Users/asd/asd/dist/server/main.js:12299:42)
at 17958 (/Users/asd/asd/dist/server/main.js:8845:67)
at webpack_require (/Users/asd/asd/dist/server/main.js:12299:42)
at 73896 (/Users/asd/asd/dist/server/main.js:6301:102)
at webpack_require (/Users/asd/asd/dist/server/main.js:12299:42)
at 11838 (/Users/asd/asd/dist/server/main.js:115:102)
at webpack_require (/Users/asd/asd/dist/server/main.js:12299:42)
at 50041 (/Users/asd/asd/dist/server/main.js:800:77)
Tried mocking the document object using domino but still same error. Also tried hiding certain components using ngIf based on platformBrowser check. The issue seems inside the bootstrap library. Anyone encountered this and found a way through?
Beta Was this translation helpful? Give feedback.
All reactions