Skip to content

nitro 3 beta package types field points to missing lib/index.d.mts #4346

Description

@Fernando-droidx

Environment

  • nitro@3.0.260610-beta
  • TypeScript latest
  • Node.js v22.13.1

Reproduction

mkdir nitro-types-repro && cd nitro-types-repro
npm install nitro@3.0.260610-beta typescript@latest --ignore-scripts --no-audit --no-fund
printf 'import type { NitroConfig } from "nitro";\nconst config: NitroConfig = {};\n' > index.ts
printf '{"compilerOptions":{"module":"commonjs","moduleResolution":"node","ignoreDeprecations":"6.0","noEmit":true,"strict":true},"include":["index.ts"]}\n' > tsconfig.json
npx tsc -p tsconfig.json --pretty false --traceResolution

Actual behavior

TypeScript follows the package's declared root types entry, but that target is not published:

'package.json' has 'types' field './lib/index.d.mts'
File '.../node_modules/nitro/lib/index.d.mts' does not exist.
index.ts(1,34): error TS2307: Cannot find module 'nitro' or its corresponding type declarations.

npm pack nitro@3.0.260610-beta --dry-run --json --ignore-scripts confirms that lib/index.d.mts is absent. The tarball does contain dist/runtime/nitro.d.mts, so modern export-aware resolution works, while Node10-style TypeScript resolution is broken by the stale root types field.

Expected behavior

Every declared package entry point should exist in the published tarball. The root types field could point to an existing declaration entry point, likely ./dist/runtime/nitro.d.mts, or be removed if legacy resolution is intentionally unsupported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions