Skip to content

Conversation

janhoogeveen
Copy link

πŸ”— Linked issue

Resolves #228

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

The helper method is initialized as an empty object as a fallback when the helper does not exist on the window object. Later in the code, it's expected that the helper has working methods. This seems to work fine when running a Nuxt app, but not in Vitest.

In this fix I add no-ops and optional chaining to prevent x is not defined on y errors.

@netlify
Copy link

netlify bot commented Sep 26, 2025

βœ… Deploy Preview for nuxt-color-mode canceled.

Name Link
πŸ”¨ Latest commit 5f54803
πŸ” Latest deploy log https://app.netlify.com/projects/nuxt-color-mode/deploys/68d688f3b8a9bc0008ae9f1e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

helper.getColorScheme is not a function error when trying to use the module

1 participant