#weird error
3 messages · Page 1 of 1 (latest)
Hi @patent dragon. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
This error is related to Vite's dependency pre-bundling and module resolution in your Nuxt project. Based on the knowledge sources, this appears to be a caching or module resolution issue with VueUse.
Solution
Try the following steps to resolve this issue:
-
Clear Vite's cache and rebuild dependencies:
rm -rf node_modules/.cache rm -rf .nuxt npm install -
If the issue persists, you may need to configure Vite's dependency optimization. Add this to your
nuxt.config.ts:export default defineNuxtConfig({ vite: { optimizeDeps: { include: ['@vueuse/core'] } } })
Why This Happens
According to a similar issue with @vueuse/shared, this type of error can occur intermittently due to Vite's dependency caching mechanism. The error indicates that Vite's pre-bundled version of @vueuse/core is missing the toValue export that your code is trying to import.
The issue is typically resolved by clearing the cache, as the pre-bundled dependencies in node_modules/.cache/vite/client/deps/ can become stale or corrupted. As noted in the GitHub issue, a Nuxt team member indicated this is "unlikely to be a Nuxt issue" and is more related to the underlying library or Vite's caching behavior.