Skip to content

Astro check fails when importing props from another component #814

@WesSouza

Description

@WesSouza

What version of astro are you using?

2.6.3

Are you using an SSR adapter? If so, which one?

Vercel

What package manager are you using?

pnpm

What operating system are you using?

Mac and Linux

What browser are you using?

N/A

Describe the Bug

One of my components was importing a type from another Astro component's Props, but that stopped working since at least 2.4.0.

// ComponentA.astro import type { Props as ComponentBProps } from './ComponentB.astro'
❯ npm run astro check > @example/minimal@0.0.1 astro > astro check 05:11:05 PM [check] Checking files 05:11:06 PM [content] No content directory found. Skipping type generation. ✔ Getting diagnostics for Astro files in /home/projects/github-2auewc/… 05:11:06 PM [diagnostics] /home/projects/github-2auewc/src/pages/ComponentA.astro:1:1 Error: Cannot find name 'Props'. 01 --- 02 import type { Props as ComponentBProps } from './ComponentB.astro' 05:11:06 PM [diagnostics] Result (3 files): - 1 error - 0 warnings - 0 hints

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-2auewc?file=src%2Fpages%2FComponentA.astro,src%2Fpages%2FComponentB.astro&on=stackblitz

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P3: minor bugAn edge case that only affects very specific usage (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions