can't use `initialTheme: 'dark'` option in nuxt
marifcelik opened this issue · comments
when i set initialTheme
value to 'dark' i got 500 document is not defined
error. im using nuxt 3 and i set this option from nux.config.ts file.
nuxt: 3.4.3
@anu-vue/nuxt: 0.13.1
Hi everyone,
I looked into this and this is because when theme is changed we are toggling the class via document
but in nuxt document
isn't defined at that time (at that time code runs on the server).
Hence, we have to handle this case in nuxt only.
I'm learning nuxt ATM but if someone have better understanding of nuxt module authoring your PR is welcome. Till I'll learn more on nuxt and fix it ASAP.
Thanks for raising the issue.