Skip to content

fix: resolve types for server auto-imports#812

Open
onmax wants to merge 1 commit intonuxt-hub:mainfrom
onmax:fix/server-auto-import-types
Open

fix: resolve types for server auto-imports#812
onmax wants to merge 1 commit intonuxt-hub:mainfrom
onmax:fix/server-auto-import-types

Conversation

@onmax
Copy link
Copy Markdown
Contributor

@onmax onmax commented Jan 30, 2026

Closes #811

Summary

Server auto-imports (db, schema, blob, kv, ensureBlob) resolve to any because TypeScript can't resolve types from relative directory paths like typeof import('../../node_modules/@nuxthub/db') that nitro generates.

The fix adds index.d.ts files to the generated virtual packages (@nuxthub/db, @nuxthub/blob, @nuxthub/kv) that re-export from the main entry point, allowing TypeScript to resolve types correctly.

StackBlitz

Link Expected
Bug nuxthub-811 ❌ implicit any
Fix nuxthub-811-fix ✅ types resolve

@vercel
Copy link
Copy Markdown

vercel bot commented Jan 30, 2026

@onmax is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

@onmax onmax force-pushed the fix/server-auto-import-types branch 2 times, most recently from ae98ad7 to cb443f1 Compare January 31, 2026 07:25
@onmax
Copy link
Copy Markdown
Contributor Author

onmax commented Jan 31, 2026

CI: playground/test/basic.test.ts times out (120s setup hook). Unrelated to this PR - all 96 actual tests pass. Same flaky behavior as main branch.

@onmax onmax force-pushed the fix/server-auto-import-types branch from cb443f1 to 61e08f6 Compare January 31, 2026 07:58
@onmax onmax marked this pull request as draft January 31, 2026 08:00
@onmax onmax force-pushed the fix/server-auto-import-types branch from 61e08f6 to feb8e2e Compare January 31, 2026 08:01
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Jan 31, 2026

npm i https://pkg.pr.new/@nuxthub/core@812

commit: 03fb8a8

@onmax onmax marked this pull request as ready for review January 31, 2026 08:22
@onmax onmax force-pushed the fix/server-auto-import-types branch from feb8e2e to 85e256c Compare March 10, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing types in server auto-imports (db, schema, blob, kv)

1 participant