Skip to content

fix: build errors for examples - #1553

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

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

@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
Comment thread edge-middleware/redirects-upstash/scripts/upstash.js Outdated
Comment thread starter/turborepo-with-hono/apps/api/package.json Outdated

@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

Comment thread starter/turborepo-with-hono/vercel.json Outdated
Comment thread edge-middleware/redirects-upstash/.env
Comment thread starter/personalization-builder-io/components/Link/Link.tsx

const excludededPrefixes = ['/favicon', '/api']

export function proxy(request: NextRequest) {

@kldavis4 kldavis4 Aug 11, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

needs a config.matcher. getPersonalizedRewrite rewrites any pathname once the visitor has a builder.userAttributes.* cookie, and excludededPrefixes only covers /favicon and /api, so _next/static goes through it

same chunk url, with and without the cookie:

no cookie:   200  application/javascript  13809 bytes
with cookie: 200  text/html                1581 bytes

so every script and stylesheet breaks for personalized visitors. new behavior too - the old pages/_middleware.tsx was the next 12 convention, it never ran on 16

export const config = {
  matcher: ['/((?!api|_next/static|_next/image|favicon.ico).*)'],
}

think this is the only blocker, and CI won't catch it - build's green, the break is at runtime

@@ -0,0 +1,5 @@
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"buildCommand": "cd ../.. && pnpm turbo build --filter=api",

@kldavis4 kldavis4 Aug 11, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

works, but CI hasn't proven it - turborepo-hono-api and examples-q42o both say "Canceled by Ignored Build Step", so nothing built on this commit. the ignoreCommand I suggested is what's hiding it, sorry

ran it locally from apps/api and it's correct, constants builds then api. worth forcing one real build before merge though

nit: turborepo wants turbo run build when it's written into config or CI, bare turbo build is for interactive use. the sibling vercel.jsons do the same thing so no strong opinion

const token = process.env.UPSTASH_REST_API_TOKEN
const url = process.env.KV_REST_API_URL
const token =
process.env.KV_REST_API_READ_ONLY_TOKEN ?? process.env.KV_REST_API_TOKEN

@kldavis4 kldavis4 Aug 11, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

|| rather than ?? here I think - a dashboard var left blank comes through as "", not undefined, so it won't fall back. token ends up "" and you get Missing required KV REST API credentials instead of just using the write token

also the old protocol guard is gone, so a bare host in KV_REST_API_URL gives a generic fetch error now instead of the targeted one. readme shows the full https:// form so low risk

checked whether the write token gets baked into the edge bundle since this runs in middleware - it doesn't, process.env is preserved for runtime lookup. no issue, just noting it so nobody else goes looking. the build-writes / runtime-reads split is nice

"baseUrl": ".",
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [

@kldavis4 kldavis4 Aug 11, 2026

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 reformat isn't prettier - --check passes on this file on main and fails now. one-key-per-line json is editor formatting, and the repo runs prettier over **/*.json via lint-staged

jsx: react-jsx and the next-env.d.ts change are real next 16 output though, a fresh build produces no further churn, so those should stay

cdn/mintlify-docs-rewrite/vercel.ts also fails the check - a pnpm prettier over both would clear it

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