Skip to content
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

defineComponent is not defined error in Nuxt #438

Closed
toniengelhardt opened this issue May 2, 2024 · 4 comments · Fixed by #439
Closed

defineComponent is not defined error in Nuxt #438

toniengelhardt opened this issue May 2, 2024 · 4 comments · Fixed by #439

Comments

@toniengelhardt
Copy link

toniengelhardt commented May 2, 2024

Describe the bug

I cannot get it to work in Nuxt (v3).

I'm getting a "defineComponent is not defined" error for both of these two scenarios:

  1. Registering the component via plugin:
import { VList } from 'virtua/vue'

export default defineNuxtPlugin({
  name: 'virtua',
  parallel: false,
  async setup() {
    nuxtApp.vueApp.component('VList', VList)
  },
})
  1. Simply importing the component and using it:
<script setup lang="ts">
import { VList } from 'virtua/vue'
</script>

<template>
  <div>
    <VList :data="data" #default="item">
      <div>
	    {{ item.property }}
      </div>
	</VList>
  </div>
</template>

How to use the package with Nuxt?

To Reproduce

See description.

Expected behavior

The component should just work as shown in the example.

Platform:

  • OS: MacOS
  • Browser: Chrome
  • Version of this package: 0.30.2
  • Version of framework: vue 3.4.21, nuxt 3.11.2

Additional context

--

@inokawa
Copy link
Owner

inokawa commented May 3, 2024

Hi, does your config have typescriptBundlerResolution: true?
#366 (comment)

@inokawa
Copy link
Owner

inokawa commented May 3, 2024

Oh, published bundle for vue seems to be broken for unknown reason. Could you try virtua: "0.29.2"?

@inokawa
Copy link
Owner

inokawa commented May 3, 2024

Fixed in 0.30.3. Thanks!

Oops, try 0.30.4.

@toniengelhardt
Copy link
Author

toniengelhardt commented May 3, 2024

Amazing, thanks 🙏🏽

Love the project!

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 a pull request may close this issue.

2 participants