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

Get Cannot find module 'astro-seo' or its corresponding type declarations.ts(2307) #49

Open
LushawnDev opened this issue Dec 23, 2022 · 6 comments

Comments

@LushawnDev
Copy link

Hey, love your Astro integration! Does it/can it support typescript out of the box or by doing npm install @types/astro-seo? I get the following error when importing it into a page like so:

---
import { SEO } from "astro-seo";
---

Gives: Cannot find module 'astro-seo' or its corresponding type declarations.ts(2307)

I am fairly new to typescript, but pretty sure it can be added to the DefinitelyTyped repo, it's just a bit past my expertise how to.

At the moment I am supressing the typescript warning by using // @ts-ignore

Thanks for your contributions!

@madrus
Copy link

madrus commented Jan 1, 2023

Same here. I am adding this line to env.d.ts as another workaround:

declare module 'astro-seo'

But it would be better to have types out of the box.

@jonasmerlin
Copy link
Owner

jonasmerlin commented Jan 16, 2023

Hey @LushawnDev and @madrus. I can't seem to reproduce this in a newly created astro project with astro 1.9.0, astro-seo 0.7.0 and TS rules set to "strictest". Can you maybe provide any steps to reproduce?

@ZermattChris
Copy link

ZermattChris commented Jan 24, 2023

Same here. I am adding this line to env.d.ts as another workaround:

declare module 'astro-seo'

But it would be better to have types out of the box.

That fixed the warning above, but it fails on Build (just installed a fresh v2.0 Astro)

@ZermattChris
Copy link

image

@Ihatetomatoes
Copy link

Try restarting TS Server or VSCode, that fixed it for me. I didn't have to add any new declarations in env.d.ts.

@alexandrstudio
Copy link

Using Zed editor and have the same issue, but solve it by adding

declare module 'astro-seo'

to env.d.ts

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

No branches or pull requests

6 participants