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

Failed to resolve component: Checkbox #1497

Open
rudachenkoev opened this issue Jan 13, 2024 · 2 comments
Open

Failed to resolve component: Checkbox #1497

rudachenkoev opened this issue Jan 13, 2024 · 2 comments
Labels

Comments

@rudachenkoev
Copy link

Description

I am using Vue 3 (Composition API) + TS + Vite.
The module is installed version 3.0.0-alpha.6.
After installing the package and declaring the plugin in main.ts I still don't have access to the Checkbox component.
As a result I get an error in the console [Vue warn]: Failed to resolve component: Checkbox

Minimal Reproducible Example

main.ts

import { VueRecaptchaPlugin } from 'vue-recaptcha/head'

app.use(VueRecaptchaPlugin, {
  v3SiteKey: import.meta.env.VITE_RECAPTCHA_SITE_KEY
})

app.vue

<script setup lang="ts">
  type RegistrationForm = {
    email: string,
    recaptcha: string
  }
  const body: RegistrationForm = reactive({
    email: '',
    recaptcha: ''
  })
</script>

<template>
  <Checkbox v-model="body.recaptcha" theme="light" />
</template>

System info

@theonelucas
Copy link

Same issue here, just following the v4 guide will lead to this error.

@DanSnow
Copy link
Owner

DanSnow commented Jan 22, 2024

To make it tree-shake able, v3 does not register these components to global. You need to import them in your code

import { Checkbox } from 'vue-recaptcha'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants