Replies: 2 comments 7 replies
-
I do not fully understand the suggestion here. Can you share the code sample for your SSR app and point out the issue there? |
Beta Was this translation helpful? Give feedback.
-
Firstly, apologies for the delay. There is a plan in the pipeline for a significant code refactor and change the way SDK is served, but it may not happen very soon. We'll scope this out as part of that and address it accordingly. Again, thanks for bringing this to our notice. |
Beta Was this translation helpful? Give feedback.
-
The SDK creates an Analytics object right in the source code like that:
It leads to the code will be run immediately when the SDK is imported into the source code. I think it is an anti-pattern because the code runs without user awareness.
Example: running the SDK on a Vuejs SSR app. The SDK currently is not universal (Nodejs friendly) so it can not be run in the SSR context. The SSR will break whenever we import the SDK. The solution is to dynamic import the SDK on the client side. But it will lead to other problems like another separate chunk, difficulty when typing for the wrapper that dynamic imports the SDK...
Beta Was this translation helpful? Give feedback.
All reactions