mikenikles / svelte-segment-events

A Svelte action to record user actions as Segment events.
2 stars 2 forks source link

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'parentNode') #24

Open deshartman opened 1 year ago

deshartman commented 1 year ago

Hi,

I have a simple Sveltekit project adding your lib, but keep hitting this error. I have the following +layout.svelte file and package.json.

`

`

The package.json file is { "name": "xxxxx", "version": "0.0.1", "private": true, "scripts": { "dev": "vite dev", "build": "vite build", "preview": "vite preview", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch" }, "devDependencies": { "@sveltejs/adapter-auto": "next", "@sveltejs/kit": "next", "svelte": "^3.44.0", "svelte-check": "^2.7.1", "svelte-preprocess": "^4.10.6", "svelte-segment-events": "^0.2.0", "tslib": "^2.3.1", "typescript": "^4.7.4", "vite": "^3.1.0" }, "type": "module" }

The error that keeps coming up is:

proxy.js?v=31a54277:15 [HMR][Svelte] Unrecoverable HMR error in <Root>: next update will trigger a full reload logError @ proxy.js?v=31a54277:15 Proxy<Root> @ proxy.js?v=31a54277:380 initialize @ client.js?t=1668995458865&v=31a54277:373 _hydrate @ client.js?t=1668995458865&v=31a54277:1570 await in _hydrate (async) start @ start.js:37 (anonymous) @ (index):71 init.svelte:69 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'parentNode') at analytics.load (init.svelte:69:23) at init2 (init.svelte:78:27) at init.svelte:84:5 at run (index.mjs:18:12) at Array.map (<anonymous>) at index.mjs:1934:58 at flush (index.mjs:1175:17) at init (index.mjs:2029:9) at new Root (root.svelte? [sm]:19:25) at createProxiedComponent (svelte-hooks.js?v=31a54277:341:9)

deshartman commented 1 year ago

This is the browser sources window: image

deshartman commented 1 year ago

Just built a Svelte project and everything works, so this seems to be a SvelteKit issue