Skip to content

Support compilerOptions.plugins inside Astro Language Server (Breaks TS Language plugins) #16917

Description

@Stephcraft

Astro Info

Astro                    v6.4.2
Vite                     v7.3.3
Node                     v24.4.0
System                   Windows (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             @astrojs/mdx (v6.0.1)
                         @astrojs/sitemap (v3.7.3)
                         astro-icon (v1.1.5)

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

No response

Describe the Bug

Currently, the Astro Language Server completely strips out or ignores third-party TypeScript plugins defined in tsconfig.json (such as typescript-yaml-plugin, typescript-plugin-css-modules, etc.) when evaluating .astro frontmatter.

The Problem:
If I use typescript-yaml-plugin, importing a .yml file inside a .ts file perfectly infers the types.
Importing that exact same .yml file inside the --- block of an .astro file degrades instantly to any.

Because the Astro Language Server initializes its own isolated tsserver instance to parse scripts, it seems to bypass the native plugin initialization hooks.

What's the expected result?

The virtual TypeScript service that Astro boots up should map and initialize the plugins array defined in the user's tsconfig.json so that custom AST parsers and module resolvers work consistently across both .ts and .astro files.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-8fbjjymg?file=src%2Fpages%2Findex.astro

Participation

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions