Skip to content

Fresh v6 astro-create project tsconfig complains of missing node types #15785

@jpc-ae

Description

@jpc-ae

Astro Info

Astro                    v6.0.0-beta.19
Vite                     v7.3.1
Node                     v24.11.0
System                   Windows (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             none

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

Describe the Bug

Astro 6 is preparing for TypeScript 6 which includes adding ["node"] to compilerOptions.types (see https://v6.docs.astro.build/en/guides/upgrade-to/v6/#changed-typescript-configuration). VS Code now complains with the following message:

[{
	"resource": "/.../astro-project/tsconfig.json",
	"owner": "typescript",
	"severity": 8,
	"message": "Cannot find type definition file for 'node'.\n  The file is in the program because:\n    Entry point of type library 'node' specified in compilerOptions",
	"source": "ts",
	"startLineNumber": 1,
	"startColumn": 1,
	"endLineNumber": 1,
	"endColumn": 2,
	"origin": "extHost2"
}]

If the "node" type dependency is going to be explicitly set, I believe @types/node should be added automatically as a dev dependency as well.

What's the expected result?

No type errors with a fresh project.

Link to Minimal Reproducible Example

https://github.com/jpc-ae/astro-minimal

Participation

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

Metadata

Metadata

Labels

- P4: importantViolate documented behavior or significantly impacts performance (priority)pkg: astroRelated to the core `astro` package (scope)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions