jonasmerlin / astro-seo

Makes it easy to add information that is relevant for SEO to your Astro app.
MIT License
933 stars 50 forks source link

Import SEO component doesn't pass astro check #38

Closed pablolazarofever closed 2 years ago

pablolazarofever commented 2 years ago

In a fresh and empty project (with astro-seo version ^0.5.0 installed), running astro check will fail if you include astro-seo as the documentation states.

---
import { SEO } from "astro-seo";
---
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width" />

        <SEO
            title="A Very Descriptive Title"
            description="A heavily optimized description full of well-researched keywords." />
    </head>
    <body>
        <h1>Astro</h1>
    </body>
</html>
> @example/minimal@0.0.1 check
> astro check

src/pages/index.astro:1:20 - Cannot find module 'astro-seo' or its corresponding type declarations.
1  import { SEO } from "astro-seo";
                       ~~~~~~~~~~~

Found 1 errors.
jonasmerlin commented 2 years ago

@pablolazarofever Sorry for the late reply. Do you know what the solution is to this?

franciskafieh commented 2 years ago

@pablolazarofever Sorry for the late reply. Do you know what the solution is to this?

Not original poster, but for now adding declare module 'astro-seo'; to my .d.ts types file fixes this. Not an npm expert, so I've no clue, but would it be possible that there are missing type declarations?

alex-grover commented 2 years ago

it looks like this can be solved by adding an index file at the top level and adjusting the exports in the package.json, like how the example template does. will open a PR shortly 👍🏽

franciskafieh commented 2 years ago

hey @jonasmerlin, can you push a new release please? this way i can remove the typedef as a workaround

P.S. @alex-grover thanks so much for the fix!

jonasmerlin commented 2 years ago

The change is now released as 0.6.0

haroldao commented 1 year ago

@pablolazarofever Sorry for the late reply. Do you know what the solution is to this?

Not original poster, but for now adding declare module 'astro-seo'; to my .d.ts types file fixes this. Not an npm expert, so I've no clue, but would it be possible that there are missing type declarations?

👀

franciskafieh commented 1 year ago

@pablolazarofever Sorry for the late reply. Do you know what the solution is to this?

Not original poster, but for now adding declare module 'astro-seo'; to my .d.ts types file fixes this. Not an npm expert, so I've no clue, but would it be possible that there are missing type declarations?

eyes

you should no longer need to do this. in 0.6.0+, the issue should be fixed :)

haroldao commented 1 year ago

@pablolazarofever Sorry for the late reply. Do you know what the solution is to this?

Not original poster, but for now adding declare module 'astro-seo'; to my .d.ts types file fixes this. Not an npm expert, so I've no clue, but would it be possible that there are missing type declarations?

eyes

you should no longer need to do this. in 0.6.0+, the issue should be fixed :)

weird... I still have to do this... ever with 0.6.0