New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read properties of undefined (reading '$isServer') #14
Comments
@jamols09 I'm not sure there is enough info here for me to help, as the error your seeing is definitely related to your project, not with the tooltip plugin itself. I would have to imagine it's something in your Vite configuration or the fact that you're loading the component asynchronously, but again, I can't reproduce the issue. Closing for now. Here's a related bug in Vite, but translation is required. Also here. |
@adamdehaven can you help me understand why the component breaks when its imported like this ? import { createApp } from './app'
createApp({
async enhanceApp(app) {
const VueCustomTooltip = await import('@adamdehaven/vue-custom-tooltip') //here But not this regular import import { createApp } from './app'
import VueCustomTooltip, {
TooltipOptions,
} from '@adamdehaven/vue-custom-tooltip' I got it to work by using the latter I just don't understand why other plugins work when imported like the first one. |
Are you utilizing the plugin inside a Vue 3 project, or are you using VuePress or Nuxt? If you can recreate the issue inside a sandbox I can help you take a look: https://codesandbox.io/s/ |
Im using Vue 3 with Vite. What's the difference between |
Ohhhh I missed that you didn't have This imports the default export from the plugin, which is the component. Glad you got it working! 🎉 |
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
I'm using Vite
//main.ts
under Vite.config.ts I've also added optimizeDeps.include the plugin
Expected behavior
The plugin should load
Screenshots
Desktop (please complete the following information):
Additional context
I'm not really sure what causes the error. I only can guess probably due to being being imported asynchronously?
The text was updated successfully, but these errors were encountered: