-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSR broke in v1.58.0 #968
Comments
thanks @pegiadise for reporting! As a workaround while we investigate, Is there a way for you to avoid calling this on the server (eg checking the window object)? While we don't want to add import time level side effects that break the server, this library is not isomorphic, and we make no guarantees that it will not explode when .load or any other method is called on a server environment (though we do our best). |
Yes, I can work around it of course, but even if it’s not isomorphic, keeping the initialization safe will go a long way with full stack frameworks. Feel free to close if it won’t be supported. |
@pegiadise I'm having trouble reproducing in any of my next.js (testing in 12 and 13) envs -- can you create a minimal example with the framework you're having an issue with? |
Yup. Will create a minimal repro during the weekend with Nuxt. |
Minimal repro repo here: https://github.com/pegiadise/segment-analytics-next-1.58.0-ssr/tree/main Logs on failure:
Probably directly related with #969 as well. Thanks for taking a look. |
Have not had additional issues come in around this since we made the change, so closing. See our next.js example links for the recommended way to initialize analytics. |
This simple Nuxt composable broke when in SSR in
v1.58.0
. I guess either instantiatingAnalyticsBrowser
or.on
or.load
has some unsafe window access in the new version. Let me know if minimal reproduction is needed.The text was updated successfully, but these errors were encountered: