nuxt-modules / color-mode

Dark and Light mode with auto detection made easy with Nuxt 🌗
https://color-mode.nuxtjs.org
MIT License
1.12k stars 112 forks source link

Cannot read properties of undefined (reading 'colorMode') #158

Closed Luferov closed 2 years ago

Luferov commented 2 years ago

Version

@nuxtjs/color-mode: ^3.1.4 nuxt-bridge:

Reproduction Link

image### What is Expected?

What is actually happening?

When ssr server crashes with an error

Luferov commented 2 years ago

When options?.colorMode - works good!

Luferov commented 2 years ago

Sometimes work smonetimes no

image
Luferov commented 2 years ago

I found a pattern. This happens when using

const router = useRouter() router.push(...)

on server

danielroe commented 2 years ago

Do you have a reproduction?