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

Cannot find module ./src/AstroSeo.astro or its corresponding type declarations #9

Open
bennycode opened this issue Nov 28, 2023 · 1 comment

Comments

@bennycode
Copy link

I installed @astrolib/seo v1.0.0-beta.4 in my TS project but when I run npx tsc --noEmit I am getting the following errors:

node_modules/@astrolib/seo/index.ts:4:37 - error TS2307: Cannot find module './src/AstroSeo.astro' or its corresponding type declarations.
4 export { default as AstroSeo } from "./src/AstroSeo.astro";

node_modules/@astrolib/seo/index.ts:5:15 - error TS2307: Cannot find module './src/AstroSeo.astro' or its corresponding type declarations.
5 export * from "./src/AstroSeo.astro";

I checked my code that imports from @astrolib/seo and it looks like it offers 2 type definitons for the same root package (located in ./index.ts and ./src/types.ts):

image

How can I tell TS to use only one of the two? I am running on TypeScript Version 5.2.2.

@bennycode
Copy link
Author

@prototypa, could this error originate from the fact the import comes from a file with a .astro extension?

There is the allowArbitraryExtensions compiler flag which states that it needs a *.d.astro.ts file for a custom extension like this.

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

1 participant