Closed ICTVTS3 closed 8 months ago
I updated to the new version but the changes weren't actually in the update as far as I can see. Adding the fix manually doesn't change anything related to the SSR problem, it's still throwing 'document is not defined'. Apparantly in combination with SSR it's a good idea to check 'browser' @ import { browser } from '$app/environment' before utilising the document variable.
Thanks for the help.
hi @dysfunc - just revisiting this since I am also seeing this issue.
I see your fix in /src
of v1.0.4 but it appears the /dist
does not have the most recently compiled code in the published npm package. You sure v1.0.4 was actually built before it was published?
Well, it looks like you both were right. I apologize for the delay on this fix. I just published 1.0.5. Can you please install the latest and let me know if your problem is resolved
It's still causing the issues. You can solve it by adding
import { browser } from '$app/env';
And changing the line in question to
$: browser && theme !== null && document && document.documentElement.setAttribute('data-picker-theme', theme);
This has been fixed and a new version has been release 1.0.6
. Please install the latest and let me know if this issue has been resolved for you.
This has been fixed and a new version has been release
1.0.6
. Please install the latest and let me know if this issue has been resolved for you.
It has, thank you :)
I'm experiencing a bug where a lot of the times on refresh my localhost crashes with the error 'document is not defined'. It stems from this line in the datepicker.svelte component:
$: theme !== null && document.documentElement.setAttribute('data-picker-theme', theme);
Thanks for checking it out :)