Skip to content

fix: register site URL for runtime overrides - #386

Merged
onmax merged 2 commits into
mainfrom
fix/runtime-site-url-registration
Aug 7, 2026
Merged

fix: register site URL for runtime overrides#386
onmax merged 2 commits into
mainfrom
fix/runtime-site-url-registration

Conversation

@onmax

@onmax onmax commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • always register runtimeConfig.public.siteUrl so Nuxt can apply NUXT_PUBLIC_SITE_URL after the app is built
  • preserve explicit config and build-time environment precedence
  • cover the unset build-time case with a focused regression test

Why

Nuxt runtime environment variables only override keys present in the built runtime config. A generic image built without NUXT_PUBLIC_SITE_URL currently omits public.siteUrl, so supplying the variable when the server starts has no effect and eventless serverAuth() can fail to resolve its base URL.

Registering an empty default keeps the key in the build while retaining the existing precedence rules. This change is intentionally independent from #87 and does not include Nitro 3 compatibility work.

Testing

  • pnpm exec vitest run test/runtime-config.test.ts test/server-auth-base-url-cache.test.ts (16 tests)
  • pnpm typecheck
  • pnpm lint
  • built the base-url-inference fixture with NUXT_PUBLIC_SITE_URL unset, then started the built Node server with NUXT_PUBLIC_SITE_URL=https://runtime.example.test; eventless serverAuth() resolved baseURL to https://runtime.example.test

@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nuxt-better-auth-docs Ready Ready Preview Aug 6, 2026 6:08pm

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 6, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
better-auth 23c115a Aug 06 2026, 06:11 PM

@pkg-pr-new

pkg-pr-new Bot commented Aug 6, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@onmax/nuxt-better-auth@386

commit: 23c115a

@onmax
onmax merged commit 0adf0ca into main Aug 7, 2026
5 of 6 checks passed
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.

1 participant