Skip to content

Guard missing Vercel Flags runtime helpers#326

Merged
dferber90 merged 5 commits intovercel:mainfrom
zzvxdoteth:codex/guard-request-context-report-value
Mar 12, 2026
Merged

Guard missing Vercel Flags runtime helpers#326
dferber90 merged 5 commits intovercel:mainfrom
zzvxdoteth:codex/guard-request-context-report-value

Conversation

@zzvxdoteth
Copy link
Contributor

@zzvxdoteth zzvxdoteth commented Mar 11, 2026

Summary

Guards internal Vercel Flags runtime helpers when Vercel does not expose the expected callable functions during evaluation.

Closes #325.

What changed

  • guard reportValue / internalReportValue before calling the request-context hook
  • guard bundled-definition loading when @vercel/flags-definitions resolves without a callable get export
  • add regressions for the Next.js override-cookie path and the missing bundled-definitions helper path
  • keep the existing patch changeset covering flags and @vercel/flags-core

Why

Both of these hooks are optional runtime plumbing from Vercel's environment. If either one is malformed or omitted, flag evaluation should degrade gracefully instead of throwing a TypeError.

Verification

  • pnpm -C packages/flags check
  • pnpm -C packages/flags type-check
  • pnpm -C packages/flags test
  • pnpm -C packages/vercel-flags-core check
  • pnpm -C packages/vercel-flags-core type-check
  • pnpm -C packages/vercel-flags-core test

@vercel
Copy link
Contributor

vercel bot commented Mar 11, 2026

@zzvxdoteth is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@zzvxdoteth zzvxdoteth changed the title Guard request-context flag reporting Guard missing Vercel Flags runtime helpers Mar 11, 2026
@vercel
Copy link
Contributor

vercel bot commented Mar 12, 2026

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

Project Deployment Actions Updated (UTC)
flags-sdk-dev Ready Ready Preview, Comment Mar 12, 2026 1:45pm
flags-sdk-next-15 Ready Ready Preview, Comment Mar 12, 2026 1:45pm
flags-sdk-next-16 Ready Ready Preview, Comment Mar 12, 2026 1:45pm
flags-sdk-snippets Ready Ready Preview, Comment Mar 12, 2026 1:45pm
flags-sdk-sveltekit-snippets Ready Ready Preview, Comment Mar 12, 2026 1:45pm
shirt-shop Ready Ready Preview, Comment Mar 12, 2026 1:45pm
shirt-shop-api Ready Ready Preview, Comment Mar 12, 2026 1:45pm

@dferber90
Copy link
Collaborator

Thank you for resolving this!

Released as

  • @vercel/flags-core@1.1.1
  • flags@4.0.5

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.

Override evaluation crashes when request-context reportValue hook is not callable

2 participants