Skip to content

fix(db): resolve extensions in tsconfig aliases#881

Open
onmax wants to merge 1 commit intonuxt-hub:mainfrom
onmax:fix/db-alias-extensions
Open

fix(db): resolve extensions in tsconfig aliases#881
onmax wants to merge 1 commit intonuxt-hub:mainfrom
onmax:fix/db-alias-extensions

Conversation

@onmax
Copy link
Copy Markdown
Contributor

@onmax onmax commented Mar 23, 2026

Closes #880

Summary

getTsconfigAliases() reads .nuxt/tsconfig.json paths which strip file extensions. Alias resolves to e.g. .nuxt/better-auth/schema but file is schema.mjs. Rolldown fails.

Now tries common extensions (.mjs, .js, .ts, .mts, .json) when the extensionless path doesn't exist.

StackBlitz

Link Expected
Bug nuxthub-alias-extensions ❌ Build fails
Fix nuxthub-alias-extensions-fix ✅ Migration generated

CLI Reproduction

git clone --depth 1 --filter=blob:none --sparse https://github.com/onmax/repros.git
cd repros && git sparse-checkout set nuxthub-alias-extensions
cd nuxthub-alias-extensions && pnpm i && npx nuxt db generate

Verify fix

git sparse-checkout add nuxthub-alias-extensions-fix
cd ../nuxthub-alias-extensions-fix && pnpm i && npx nuxt db generate

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 23, 2026

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

A member of the Team first needs to authorize it.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 23, 2026

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

commit: e9ca36f

@onmax onmax force-pushed the fix/db-alias-extensions branch 3 times, most recently from 3ec8679 to b5cc471 Compare March 23, 2026 17:01
@onmax onmax force-pushed the fix/db-alias-extensions branch from b5cc471 to e9ca36f Compare March 23, 2026 18:27
@onmax onmax marked this pull request as ready for review March 23, 2026 18:28
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.

nuxt db generate fails to resolve .mjs aliases from tsconfig

1 participant