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

Typecheck error coming from this module #336

Closed
Yizack opened this issue Sep 19, 2024 · 10 comments · Fixed by #339
Closed

Typecheck error coming from this module #336

Yizack opened this issue Sep 19, 2024 · 10 comments · Fixed by #339
Assignees
Labels
bug Something isn't working released

Comments

@Yizack
Copy link
Contributor

Yizack commented Sep 19, 2024

🐛 The bug

When installing this module in a clean Nuxt app and running the typecheck command npx vue-tsc --noEmit it shows the following error in console

Screenshot 2024-09-18 203857

🛠️ To reproduce

https://stackblitz.com/edit/github-qaxbsn

  1. Wait for install and dev commands to run
  2. Execute npx vue-tsc --noEmit in console

🌈 Expected behaviour

Shouldn't show an error

ℹ️ Additional context

  • nuxt: 3.13.2
  • vue-tsc: 2.1.6
  • @nuxtjs/turnstile: 0.9.6
@Yizack Yizack added the bug Something isn't working label Sep 19, 2024
@dargmuesli
Copy link
Collaborator

I'm unsure how to fix this properly, @danielroe may I ask for your assistance?

@Yizack
Copy link
Contributor Author

Yizack commented Sep 22, 2024

I managed to have a fix for this but I'm unsure if this is the right approach

By adding this in /src/module.ts

turnstile/src/module.ts

Lines 128 to 131 in 146cad4

addTypeTemplate({
filename: 'types/cloudflare-turnstile.d.ts',
getContents: () => `/// <reference types="@types/cloudflare-turnstile" />`,
})

and moving @types/cloudflare-turnstile from devDependencies to dependencies

turnstile/package.json

Lines 55 to 60 in 146cad4

"dependencies": {
"@types/cloudflare-turnstile": "0.2.2",
"@nuxt/kit": "^3.13.1",
"defu": "^6.1.4",
"pathe": "^1.1.2"
},

With these changes we get rid of the type error in a fresh install (deleting node_modules and package-lock.json)

Happy to open a PR if it is ok!

@danielroe
Copy link
Collaborator

You're right, it should be a dependency!

Is that sufficient?

Please do open a PR - I will amend as necessary 🙏

@Yizack
Copy link
Contributor Author

Yizack commented Sep 22, 2024

@danielroe it is sufficient! I'm doing it right now!

@dargmuesli-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 0.9.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

@dargmuesli
Copy link
Collaborator

@danielroe
Copy link
Collaborator

danielroe commented Sep 23, 2024

@Yizack
Copy link
Contributor Author

Yizack commented Sep 23, 2024

@danielroe

I'm sorry, I thought it was solved with my change, but I noticed in the previous version 0.9.7 if I have the .npmrc file it doesn't log any error (it did in 0.9.6 even with it, now it's logging the error back in 0.9.8)

I didn't test without the .npmrc file previously

Reproduction: https://stackblitz.com/edit/github-qaxbsn-sal6jg?file=.npmrc,package.json

@danielroe
Copy link
Collaborator

I believe this is now hotfixed in 839cbfc.

@Yizack
Copy link
Contributor Author

Yizack commented Sep 23, 2024

It's fixed for me, thank you for addressing the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants