Skip to content

fix(db): correct D1 migrations_dir path in wrangler.json#814

Merged
RihanArfan merged 2 commits intonuxt-hub:mainfrom
onmax:fix/d1-migrations-dir-path
Feb 2, 2026
Merged

fix(db): correct D1 migrations_dir path in wrangler.json#814
RihanArfan merged 2 commits intonuxt-hub:mainfrom
onmax:fix/d1-migrations-dir-path

Conversation

@onmax
Copy link
Copy Markdown
Contributor

@onmax onmax commented Feb 1, 2026

Closes #813
Fixes same bug as #793 but in CLI code path (PR #794 only fixed setup.ts, missed client.ts)

Summary

Two fixes:

  1. migrations_dir path - migrations_dir in generated wrangler.json was set to .output/server/db/migrations/ but wrangler resolves paths relative to its config file location (.output/server/). This caused doubled paths like .output/server/.output/server/db/migrations/. Fixed by setting the path relative to wrangler.json: db/migrations/sqlite/.

  2. D1 API endpoint - client.ts used wrong endpoint /d1/db/ instead of /d1/database/, causing POST method errors when running CLI commands against D1.

Regression introduced in #720.

StackBlitz

Link Expected
Bug nuxthub-813 ❌ migrations_dir has wrong prefix
Fix nuxthub-813-fix ✅ migrations_dir is correct

CLI Reproduction

git clone --depth 1 --filter=blob:none --sparse https://github.com/onmax/repros.git
cd repros && git sparse-checkout set nuxthub-813
cd nuxthub-813 && pnpm i && pnpm build
cat .output/server/wrangler.json | grep migrations_dir

Verify fix

git sparse-checkout add nuxthub-813-fix
cd ../nuxthub-813-fix && pnpm i && pnpm build
cat .output/server/wrangler.json | grep migrations_dir

The -fix folder uses pnpm patch to apply the fix locally.

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 1, 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 Feb 1, 2026

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

commit: 567490b

@RihanArfan RihanArfan merged commit a94f1cd into nuxt-hub:main Feb 2, 2026
7 of 9 checks passed
onmax added a commit to onmax/core that referenced this pull request Feb 5, 2026
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.

Wrangler configuration is incorrectly generated

2 participants