ng-clarity
ng-clarity copied to clipboard
Clarity is not compatible with Analog (SSR)
This is a bug report for the @clr
Angular or UI versions of the design system.
Describe the bug
Clarity is not compatible with Analog
How to reproduce
Steps to reproduce the behavior:
- Create an Analog app following the Getting Started instructions here
- Add Clarity following instructions here
- The new app uses standalone components so there won't be an
AppModule
. Instead, addClarityModule
to the imports of theAppComponent
- Run
npm start
- See error
ERROR Error: Uncaught (in promise): ReferenceError: window is not defined
ReferenceError: window is not defined
at [path to the app]/node_modules/@cds/core/internal/utils/exists.js:1:209
Expected behavior
Application should run
Versions
Clarity version:
- @cds/core: "6.7.0"
- @clr/angular: "16.0.0"
- @clr/ui: "16.0.0"
Framework version:
Angular 16
Device:
- Type: Desktop
- OS: Windows - running project on WSL 2
- Browser: N/A
- Version: N/A
Additional notes
I suspect there would be similar error even just for a standard Angular SSR integration
This is likely not something we will focus on supporting.
Server-side rendering is important for many, many apps these days. Not supporting SSR, will automatically remove Clarity as an option for many projects.
I hope you'll reconsider.