Skip to content

fix: build errors for examples - #1553

Open
ecklf wants to merge 4 commits into
mainfrom
ecklf/fix-build-errors
Open

fix: build errors for examples#1553
ecklf wants to merge 4 commits into
mainfrom
ecklf/fix-build-errors

Conversation

@ecklf

@ecklf ecklf commented Aug 7, 2026

Copy link
Copy Markdown
Member

Description

Fixes build failures surfaced while validating the Bun WebSocket example PR:

  • Mintlify docs rewrite: Vercel config validation reported rewrite entries without a destination. Use routes.rewrite() so dynamic destinations are emitted correctly.
  • Split feature flag example: @vercel/global-config initialized during module evaluation and failed when no connection string was available during the build. Create the client lazily when handling a request.
  • Upstash redirects: the documented POPULATE_REDIS=false opt-out was treated as truthy. Compare the value explicitly so population can be disabled.
  • Turborepo Hono API: TypeScript could not resolve @repo/constants because the workspace dependency had not been built. Build it before compiling the API.
  • Blob SvelteKit: Turbo restored .svelte-kit but omitted the adapter-generated .vercel/output, causing Vercel to report a missing output directory. Include .vercel/output/** in cached build outputs.

Vercel project root settings were also corrected for the Services examples; their redeployments now pass.

Verification

  • Ran the affected pnpm builds locally.
  • Validated the Mintlify config with Vercel CLI 58.1.0.
  • Confirmed passing Vercel deployments for Blob SvelteKit, Split, Mintlify, and both Hono API projects.

The Upstash deployment still depends on replacing or disabling its stale Redis endpoint.

Type of Change

  • New Example
  • Example updates (Bug fixes, new features, etc.)
  • Other (changes to the codebase, but not to examples)

@ecklf
ecklf requested a review from a team as a code owner August 7, 2026 12:40
@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
app-dir-css-in-js Ready Ready Preview Aug 10, 2026 9:02am
app-dir-i18n Ready Ready Preview Aug 10, 2026 9:02am
app-dir-share-state Ready Ready Preview Aug 10, 2026 9:02am
blob-starter Ready Ready Preview Aug 10, 2026 9:02am
blob-sveltekit Ready Ready Preview Aug 10, 2026 9:02am
cms-webhook-update-redirects Ready Ready Preview Aug 10, 2026 9:02am
container-images-demo Ready Ready Preview Aug 10, 2026 9:02am
cron Ready Ready Preview Aug 10, 2026 9:02am
custom-error-pages-app-dir Ready Ready Preview Aug 10, 2026 9:02am
custom-error-pages-public-dir Ready Ready Preview Aug 10, 2026 9:02am
django Ready Ready Preview Aug 10, 2026 9:02am
django-notes Ready Ready Preview Aug 10, 2026 9:02am
django-rest-framework-example Ready Ready Preview Aug 10, 2026 9:02am
edge-ab-testing-statsig Ready Ready Preview Aug 10, 2026 9:02am
edge-functions-ab-testing-simple Ready Ready Preview Aug 10, 2026 9:02am
edge-functions-add-header Ready Ready Preview Aug 10, 2026 9:02am
edge-functions-basic-auth-password Ready Ready Preview Aug 10, 2026 9:02am
edge-functions-bot-protection-botd Ready Ready Preview Aug 10, 2026 9:02am
edge-functions-bot-protection-datadome Ready Ready Preview Aug 10, 2026 9:02am
edge-functions-cookies Ready Ready Preview Aug 10, 2026 9:02am
edge-functions-crypto Ready Ready Preview Aug 10, 2026 9:02am
edge-functions-feature-flag-configcat Ready Ready Preview Aug 10, 2026 9:02am
edge-functions-feature-flag-posthog Ready Ready Preview Aug 10, 2026 9:02am
edge-functions-feature-flag-split Ready Ready Preview Aug 10, 2026 9:02am
edge-functions-geolocation Ready Ready Preview Aug 10, 2026 9:02am
edge-functions-hostname-rewrites Ready Ready Preview Aug 10, 2026 9:02am
edge-functions-i18n Ready Ready Preview Aug 10, 2026 9:02am
edge-functions-image-response Ready Ready Preview Aug 10, 2026 9:02am
edge-functions-ip-blocking-datadome Ready Ready Preview Aug 10, 2026 9:02am
edge-functions-json-response Ready Ready Preview Aug 10, 2026 9:02am
edge-functions-jwt-authentication Ready Ready Preview Aug 10, 2026 9:02am
edge-functions-power-parity-pricing Ready Ready Preview Aug 10, 2026 9:02am
edge-functions-power-parity-pricing-strategies Ready Ready Preview Aug 10, 2026 9:02am
edge-functions-query-params-filter Ready Ready Preview Aug 10, 2026 9:02am
edge-functions-redirects-upstash Ready Ready Preview Aug 10, 2026 9:02am
edge-geolocation-country-block Ready Ready Preview Aug 10, 2026 9:02am
edge-maintenance-page Ready Ready Preview Aug 10, 2026 9:02am
edge-middleware-modify-request-header Ready Ready Preview Aug 10, 2026 9:02am
edge-rewrites-upstash Ready Ready Preview Aug 10, 2026 9:02am
edge-user-agent-based-rendering Ready Ready Preview Aug 10, 2026 9:02am
example-bun Ready Ready Preview Aug 10, 2026 9:02am
example-express-bun Ready Ready Preview Aug 10, 2026 9:02am
example-feature-flag-apple-store Ready Ready Preview Aug 10, 2026 9:02am
example-hono-bun Ready Ready Preview Aug 10, 2026 9:02am
example-nitro-bun Ready Ready Preview Aug 10, 2026 9:02am
example-reduce-image-bandwidth-usage Ready Ready Preview Aug 10, 2026 9:02am
example-websockets-bun Ready Ready Preview Aug 10, 2026 9:02am
examples Ready Ready Preview Aug 10, 2026 9:02am
examples-q42o Error Error Aug 10, 2026 9:02am
experimentation-statsig Ready Ready Preview Aug 10, 2026 9:02am
express-ai-sdk-demo Ready Ready Preview Aug 10, 2026 9:02am
fantix-examples-nextjs-fastapi Ready Ready Preview Aug 10, 2026 9:02am
fastapi-ai-chat Ready Ready Preview Aug 10, 2026 9:02am
feature-flag-hypertune Ready Ready Preview Aug 10, 2026 9:02am
feature-flag-launchdarkly Ready Ready Preview Aug 10, 2026 9:02am
feature-flag-optimizely Ready Ready Preview Aug 10, 2026 9:02am
flags-sdk-flagsmith Ready Ready Preview Aug 10, 2026 9:02am
flags-sdk-growthbook Ready Ready Preview Aug 10, 2026 9:02am
flags-sdk-launchdarkly Ready Ready Preview Aug 10, 2026 9:02am
flags-sdk-openfeature Ready Ready Preview Aug 10, 2026 9:02am
flags-sdk-posthog Ready Ready Preview Aug 10, 2026 9:02am
flags-sdk-reflag Ready Ready Preview Aug 10, 2026 9:02am
flags-sdk-vercel Ready Ready Preview Aug 10, 2026 9:02am
geolocation-script Ready Ready Preview Aug 10, 2026 9:02am
hono Ready Ready Preview Aug 10, 2026 9:02am
hono-ai-sdk Ready Ready Preview Aug 10, 2026 9:02am
hono-mcp-example Ready Ready Preview Aug 10, 2026 9:02am
i18n Ready Ready Preview Aug 10, 2026 9:02am
kv-redis-starter Ready Ready Preview Aug 10, 2026 9:02am
laurens-test Ready Ready Preview Aug 10, 2026 9:02am
litellm-gateway-demo Ready Ready Preview Aug 10, 2026 9:02am
microfrontends-docs Ready Ready Preview Aug 10, 2026 9:02am
microfrontends-marketing Ready Ready Preview Aug 10, 2026 9:02am
mint-nft Ready Ready Preview Aug 10, 2026 9:02am
mintlify-docs-rewrite Ready Ready Preview Aug 10, 2026 9:02am
next-fastapi-monorepo Error Error Aug 10, 2026 9:02am
nextjs-fastapi Ready Ready Preview Aug 10, 2026 9:02am
nextjs-fastapi-bindings Ready Ready Preview Aug 10, 2026 9:02am
nextjs-gin Ready Ready Preview Aug 10, 2026 9:02am
nitro Ready Ready Preview Aug 10, 2026 9:02am
nitro-cached-handler Ready Ready Preview Aug 10, 2026 9:02am
nitro-plugins Ready Ready Preview Aug 10, 2026 9:02am
nitro-route-rules Ready Ready Preview Aug 10, 2026 9:02am
nitro-websocket Ready Ready Preview Aug 10, 2026 9:02am
nodejs-api Ready Ready Preview Aug 10, 2026 9:02am
nuxt-websocket Ready Ready Preview Aug 10, 2026 9:02am
nx-monorepo Ready Ready Preview Aug 10, 2026 9:02am
postgres-drizzle Ready Ready Preview Aug 10, 2026 9:02am
postgres-kysely Ready Ready Preview Aug 10, 2026 9:02am
postgres-starter Ready Ready Preview Aug 10, 2026 9:02am
redirect-with-fallback Ready Ready Preview Aug 10, 2026 9:02am
redirects-bloom-filter Ready Ready Preview Aug 10, 2026 9:02am
rust-axum Ready Ready Preview Aug 10, 2026 9:02am
rust-hello-world Ready Ready Preview Aug 10, 2026 9:02am
rust-websocket Ready Ready Preview Aug 10, 2026 9:02am
saas-microservices-api Ready Ready Preview Aug 10, 2026 9:02am
saas-microservices-api-dashboard Ready Ready Preview Aug 10, 2026 9:02am
saas-microservices-api-users Ready Ready Preview Aug 10, 2026 9:02am
saas-microservices-dashboard Ready Ready Preview Aug 10, 2026 9:02am
single-spa-content-microfrontend Ready Ready Preview Aug 10, 2026 9:02am
single-spa-root-microfrontend Ready Ready Preview Aug 10, 2026 9:02am
solutions-combining-data-fetching-strategies Ready Ready Preview Aug 10, 2026 9:02am
solutions-image-fallback Ready Ready Preview Aug 10, 2026 9:02am
solutions-image-offset Ready Ready Preview Aug 10, 2026 9:02am
solutions-loading-web-fonts Ready Ready Preview Aug 10, 2026 9:02am
solutions-microfrontends Ready Ready Preview Aug 10, 2026 9:02am
solutions-microfrontends-docs Ready Ready Preview Aug 10, 2026 9:02am
solutions-on-demand-isr Ready Ready Preview Aug 10, 2026 9:02am
solutions-pagination-with-ssg Ready Ready Preview Aug 10, 2026 9:02am
solutions-reuse-responses Ready Ready Preview Aug 10, 2026 9:02am
solutions-script-component-ad Ready Ready Preview Aug 10, 2026 9:02am
solutions-script-component-strategies Ready Ready Preview Aug 10, 2026 9:02am
solutions-subdomains-auth Ready Ready Preview Aug 10, 2026 9:02am
starter-test Error Error Aug 10, 2026 9:02am
toolbar-feature-flags-sveltekit Ready Ready Preview Aug 10, 2026 9:02am
toolbar-launchdarkly Ready Ready Preview Aug 10, 2026 9:02am
toolbar-optimizely Ready Ready Preview Aug 10, 2026 9:02am
toolbar-statsig Ready Ready Preview Aug 10, 2026 9:02am
turborepo-hono-api Error Error Aug 10, 2026 9:02am
turborepo-hono-web Ready Ready Preview Aug 10, 2026 9:02am
vercel-plus-fastapi Ready Ready Preview Aug 10, 2026 9:02am
vite-fastapi Ready Ready Preview Aug 10, 2026 9:02am
vue Ready Ready Preview Aug 10, 2026 9:02am
xmcp-demo Ready Ready Preview Aug 10, 2026 9:02am
14 Skipped Deployments
Project Deployment Actions Updated (UTC)
build-output-api-draft-mode Ignored Ignored Preview Aug 10, 2026 9:02am
build-output-api-edge-functions Ignored Ignored Preview Aug 10, 2026 9:02am
build-output-api-edge-middleware Ignored Ignored Preview Aug 10, 2026 9:02am
build-output-api-image-optimization Ignored Ignored Preview Aug 10, 2026 9:02am
build-output-api-isr Ignored Ignored Preview Aug 10, 2026 9:02am
build-output-api-overrides Ignored Ignored Preview Aug 10, 2026 9:02am
build-output-api-prerender-functions Ignored Ignored Preview Aug 10, 2026 9:02am
build-output-api-routes Ignored Ignored Preview Aug 10, 2026 9:02am
build-output-api-serverless-functions Ignored Ignored Preview Aug 10, 2026 9:02am
build-output-api-static-files Ignored Ignored Preview Aug 10, 2026 9:02am
build-output-api-wildcard Ignored Ignored Preview Aug 10, 2026 9:02am
example-auth-with-ory Ignored Ignored Preview Aug 10, 2026 9:02am
solutions-nx-monorepo Ignored Ignored Preview Aug 10, 2026 9:02am
solutions-testing Ignored Ignored Preview Aug 10, 2026 9:02am

@vercel vercel Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

renderLink={Link} fails type checking because Link is typed as FC, whose React 19 return type ReactNode | Promise<ReactNode> is not assignable to renderLink's expected (props) => ReactNode.

Fix on Vercel

@ecklf ecklf changed the title fix: build errors fix: build errors for examples Aug 7, 2026
await writeFile(filePath, content)

if (!process.env.POPULATE_REDIS) {
if (process.env.POPULATE_REDIS === 'false') {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this flips the default, not just the opt-out. before: unset or empty meant skip. now anything that isn't the exact string false populates, so an env without POPULATE_REDIS falls into the try block, hits upstash(), and throws Missing required Upstash credentials of the REST API at line 10. that build used to succeed with just the 1000 hardcoded redirects

probably fine inside this repo since .env is committed with POPULATE_REDIS = true, but anyone copying just the app dir gets a hard build failure where they didn't before. maybe:

const populate = process.env.POPULATE_REDIS
if (populate === 'false' || !populate) {

also worth noting this doesn't actually fix the red check — edge-functions-redirects-upstash is still failing and the committed .env keeps it at true, so the new opt-out never gets exercised in CI. I think either set it to false in .env (or as a project env var, since next won't override process.env) or pull this hunk out into its own PR? otherwise it looks fixed but isn't

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I restored population as explicit opt-in with POPULATE_REDIS=true and set the committed .env value to false. Imo it makes more sense to do the skip path by default?

"type": "module",
"scripts": {
"build": "tsc",
"build": "pnpm --filter @repo/constants build && tsc",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

turbo.json already has "build": { "dependsOn": ["^build"] }, so turbo run build builds @repo/constants first. with this change it gets built twice on a cold build — once under turbo's cache via ^build, then again as an uncached nested pnpm --filter inside api#build. harmless today since apps/web doesn't import constants, but it rewrites packages/constants/dist outside turbo's knowledge, which is a torn-output risk the moment a second parallel consumer shows up

I think the real issue is that the api project isn't building through turbo from the repo root — there's no vercel.json anywhere under starter/turborepo-with-hono, so it's relying on dashboard settings. redirects-upstash and blob-sveltekit both pin "buildCommand": "pnpm turbo build" in a checked-in vercel.json, seems like the same thing would work here and keeps the dependency expressed in one place

minor, but this also makes the api build pnpm-only while apps/api/README.md still tells people to run npm install && npm run dev

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a pin for the build command in vercel.json do you think that's the way to go here?

@vercel vercel Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestions:

  1. req.cookies (a RequestCookies object) is passed where getPersonalizedRewrite expects a Record<string, string>, causing a TypeScript build failure.
  1. api build fails with TS2307: Cannot find module '@repo/constants' because the workspace dependency is never built before apps/api's tsc runs.

Fix on Vercel

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.

3 participants