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.
Environment
nitro@3.0.260610-betaReproduction
Actual behavior
TypeScript follows the package's declared root
typesentry, but that target is not published:npm pack nitro@3.0.260610-beta --dry-run --json --ignore-scriptsconfirms thatlib/index.d.mtsis absent. The tarball does containdist/runtime/nitro.d.mts, so modern export-aware resolution works, while Node10-style TypeScript resolution is broken by the stale roottypesfield.Expected behavior
Every declared package entry point should exist in the published tarball. The root
typesfield could point to an existing declaration entry point, likely./dist/runtime/nitro.d.mts, or be removed if legacy resolution is intentionally unsupported.