Skip to content

Astro check not resolving dependencies from project directory #17135

Description

@lyphyser

Astro Info

Astro                    v6.4.8
Node                     v26.3.1
System                   Linux (arm64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             postprocess

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

astro check is resolving dependencies from its own directory (and thus not accessing the user's project dependencies, in case the astro directory is an a virtual global store not under the project directory), but doesn't declare typescript and @astrojs/check as dependencies, so it can't find them.

It should resolve from the user's project directory instead, so it can find them, e.g. with
createRequire(pathToFileURL(join(root, 'package.json'))).resolve('@astrojs/check')

What's the expected result?

It finds typescript and @astrojs/check when installed in the user's project directory, even if the astro dependency directory is not a child of it

Link to Minimal Reproducible Example

http://example.com/not-applicable

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)pkg: astroRelated to the core `astro` package (scope)triage: fix verifiedReporter confirmed the triage bot fix works

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions