Open ODAncona opened 9 months ago
I have the same Problem
Same problem too ; Did you solved the issue? Thx
I'm having the same problem, if I reinforce to use Inject(DOCUMENT) wouldn't it solve both for document and for window so it would be possible to reuse it in ssr?
Same error. Any update on this?
Same problem. Did anyone find a way to fix?
const document = new Document()
on constructor and solved for me
Has anyone managed to solve this?
Any news ?
Bug Report or Feature Request (mark with an
x
)Expected behavior:
The library should be compatible with SSR and shouldn't throw an error related to the usage of
document
or any other browser-specific API.Current behavior:
When running the application with SSR
npm run dev:ssr
, an error related todocument is not defined
appears in the server console.Steps to reproduce:
ng2-pdf-viewer
library.npm run dev:ssr
command.document is not defined
.Or clone the repo I made for this error
Minimal Reproduction of SSR error
Related code:
I didn't forget to add the
canvas
dependencies in angular.json as mentionned in the issue #908Error log:
Environment:
Additional information:
The error seems to originate from a dependency (
pdfjs-dist
). It's possible that this dependency isn't fully compatible with SSR. If there is a solution or workaround specifically for this library in the context of SSR, it would be appreciated.