Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Bug (Nuxt:Colormode): Static deployments on Nuxt.js does not initialize with cookie color mode. #288

Open
codebender828 opened this issue Mar 13, 2023 — with Volta.net · 0 comments
Labels
nuxt type: bug 🐛 Something isn't working type: contributions welcome 💚 Contributions are welcome!

Comments

Copy link
Collaborator

Since statically pre-rendered routes pre-render the page, the color mode is already inserted in the Chakra Application.

With Nuxt Server deployment, the Chakra Module is able to extract the current color mode based on the user's cookie content.

However, with static rendering, this process gets interfered with. To solve this we need to:

  1. Fallback to using localStorage for pages prerendered with Nitro. The client plugin already uses this approach.
  2. Detect the current rendering mode, and apply the colorModeManager in the Nuxt plugin and apply it here
@codebender828 codebender828 added nuxt type: bug 🐛 Something isn't working type: contributions welcome 💚 Contributions are welcome! labels Mar 13, 2023 — with Volta.net
@codebender828 codebender828 changed the title bug(Nuxt:Colormode): Static deployments on Nuxt.js does not initialize with cookie color mode. Bug (Nuxt:Colormode): Static deployments on Nuxt.js does not initialize with cookie color mode. Mar 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
nuxt type: bug 🐛 Something isn't working type: contributions welcome 💚 Contributions are welcome!
Projects
None yet
Development

No branches or pull requests

1 participant