Receive [vite] Internal server error: window is not defined when I try to view http://localhost:4200. #299
-
Hello, I was hoping to get some help on the following issue I am facing with angular 17 and Clarity core 6.10.0 Versions of what I am using:
OS version:
The error that I see
What I did to get this error to happen using the default angular setup.
Installed the clarity packages
The steps from here: Just to be clear just incase Im might have not understood Step 5. Here is what my app.module.ts looks like.
Then I run.
Put the http://localhost:4200 in my firefox browser and I get the error:
I am just now getting started with this so a newbie maybe I missed something? I check the compat guide and that all looks well I guess I am missing something perhaps or have it setup wrong. The one thing that I have figured out from messing with this all day is that it happens with the SSR being set and from looking around the web. Looks like the window var is not defined until it is used in the browser mode so on the server it is not defined. I don't know if it may be a issue I need to file a issue on or I just missed something. Any help would be much appreciated point to a docs I may have missed would be great as well. Hopefully someone will be able to say go look here to see what you need to do. If something else is needed that I didn't put let me know I didn't add any code just using the default angular code that gets generated. I checked to see that the default angular page showed before I added the clarity steps. Thanks in advanced. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Unfortunately, Clarity components are not guaranteed to be SSR compatible. This is not a use case that we currently support. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the information Kevin. Would it be worth me opening a feature request in the clarity core area for you all to look into if one is not currently open? Thanks |
Beta Was this translation helpful? Give feedback.
-
Thanks, Kevin will open it just in case someone else hits it thanks for the update will see what I will do have a great day. |
Beta Was this translation helpful? Give feedback.
Unfortunately, Clarity components are not guaranteed to be SSR compatible. This is not a use case that we currently support.