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

Error: Can't resolve '@unhead/vue' in '.../node_modules/vue-recaptcha/dist/script-manager' #1425

Open
WeiLocus opened this issue Oct 26, 2023 · 4 comments
Labels

Comments

@WeiLocus
Copy link

Description

In main.ts
import { VueRecaptchaPlugin } from 'vue-recaptcha/head';

ERROR in src/main. ts
TS2307: Cannot find module ‘vue-recaptcha/head' or its corresponding type declarations.

Minimal Reproducible Example

Use Vue CLi + TS .

define
import { VueRecaptchaPlugin } from 'vue-recaptcha'; const app = createApp(App); app.use(VueRecaptchaPlugin, { v2SiteKey: '6......._yj', });

npm run serve then got fail.

System info

System:
OS: macOS

Binaries:
Node: 18.12.1

npmPackages:
vue: ^3.0.7,
vue-recaptcha: "^3.0.0-alpha.6",
typescript: "~4.5.5",

@WeiLocus WeiLocus added the bug label Oct 26, 2023
@chuckhousley
Copy link

chuckhousley commented Oct 27, 2023

I'm able to get the build working on your minimal example by moving @unhead/vue from devDependencies to dependencies and adding @vue/compat to the dependencies as well. I think this suggests that the alpha version has not finished migrating to vue 3 and is not ready for use yet

@ricardo17coelho
Copy link

I'm also facing this issue..

@ricardo17coelho
Copy link

https://dansnow.github.io/vue-recaptcha/guide#usage-without-unhead

I guess this fix the issue.

@DanSnow
Copy link
Owner

DanSnow commented Jan 22, 2024

I'll remove the default unhead integration as it seems to cause a lot of issue

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

4 participants