Skip to content

fix(www): prevent build failure when NEXT_PUBLIC_APP_URL is missing#903

Merged
Yeom-JinHo merged 2 commits intomagicuidesign:mainfrom
Yeom-JinHo:fix/missing-var
Mar 2, 2026
Merged

fix(www): prevent build failure when NEXT_PUBLIC_APP_URL is missing#903
Yeom-JinHo merged 2 commits intomagicuidesign:mainfrom
Yeom-JinHo:fix/missing-var

Conversation

@Yeom-JinHo
Copy link
Collaborator

Description

This PR focuses on fixing production build failures when NEXT_PUBLIC_APP_URL is missing in the www app.

Changes

  • URL Fallback (major fix): Updated absoluteUrl() to use siteConfig.url when NEXT_PUBLIC_APP_URL is not set.
  • Metadata Generation: Replaced direct environment-based OG URL creation with absoluteUrl("/og") in docs and showcase metadata.
  • URL Safety: Switched to new URL()-based composition to ensure valid absolute URLs for metadata and structured data.
  • Type Cleanup: Changed Metadata import to import type in utils.ts.

Motivation

  • Production deployments were failing during SSG/prerender with TypeError: Invalid URL when NEXT_PUBLIC_APP_URL was empty or undefined.
  • Metadata code in docs/showcase relied on direct env string interpolation, which made builds fragile across environments.
  • This change makes build behavior deterministic and environment-agnostic by using a stable fallback base URL.

Breaking Changes

  • None.
  • Existing behavior is preserved when NEXT_PUBLIC_APP_URL is provided.
  • When missing, the app now safely falls back to siteConfig.url instead of failing the build.

@vercel
Copy link

vercel bot commented Mar 2, 2026

@Yeom-JinHo is attempting to deploy a commit to the product-studio Team on Vercel.

A member of the Team first needs to authorize it.

@Yeom-JinHo Yeom-JinHo merged commit c11e9a7 into magicuidesign:main Mar 2, 2026
3 of 4 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