Closed quadmachine closed 1 year ago
Hi @quadmachine could you provide a simple repo to replicate this?
Sure, I've created a repo here, this is a basic Nuxt starter, only relevant stuff would be in the trackSrrPageLoad.ts
here
https://stackblitz.com/edit/nuxt-starter-2nzhse?file=README.md,modules%2FserverSideTracking%2Fhooks%2FtrackSrrPageLoad.ts everything else is Nuxt boilerplate.
Just run yarn dev
to start the app, it will try to track the initial page load once it build but will throw with the error ReferenceError: window is not defined
Thanks for any help <3
@thyngster I've perhaps fixed the issue, in clientHints
function check on line 211 doesn't break if I change from
if (window && !('navigator' in window)) {
to
if (typeof window === 'undefined') {
Perhaps I can make a MR for this?
I'm publishing a fix today
@quadmachine A fix is in place in version 0.0.5
@thyngster Can confirm the fix is working, tnx!
Hi, I'm trying to send a tracking event using your library, it's running in a Nuxt app, within SSR context, so basically Node, and
window
and other browser specific stuff is not available. Sending fails with error:This is my code:
Maybe I'm missing some configuration option, or perhaps it's a bug? Not sure, any help is appreciated.