My Angular app is using a 3rd party library: ngx-highlightjs and it throws an error when running the app in SSR mode:
requestAnimationFrame is not defined
Digging into the stack trace revealed it’s due to the use of this line:
animationFrameScheduler.schedule(() => // ... );
- Repo link: I will update this shortly
I’m actually not sure if it should be the responsibility of rxjs to make
animationFrameScheduler work in NodeJS or if it should be the responsibility of the library author to write SSR-friendly implementation.
It looks like there are a lot of similar issues in the wild so my first impression is for this issue to be fixed at the rxjs level. Then all these other issues will miraculously be resolved!
- Runtime: Node v12
- RxJS version: 6.6.3
- angular/core: 9.1.13 (in case this is relevant)