Skip to content

fix(ui): Add missing noop methods to unsafeMetadata field in SignUpStart#8500

Merged
wobsoriano merged 4 commits intomainfrom
rob/fix-8496
May 7, 2026
Merged

fix(ui): Add missing noop methods to unsafeMetadata field in SignUpStart#8500
wobsoriano merged 4 commits intomainfrom
rob/fix-8496

Conversation

@wobsoriano
Copy link
Copy Markdown
Member

Description

Fixes TypeError: e.clearFeedback is not a function when <SignUp unsafeMetadata={...} /> is used and a Clerk API error is thrown. The unsafeMetadata synthetic field pushed to fieldsToSubmit was missing clearFeedback and setError stubs, unlike every other synthetic field in the same function.

Fixes #8496 #3996

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@vercel
Copy link
Copy Markdown

vercel Bot commented May 7, 2026

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

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment May 7, 2026 6:06pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 7, 2026

🦋 Changeset detected

Latest commit: 1f95f07

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@clerk/ui Patch
@clerk/chrome-extension Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added the ui label May 7, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 7d30a8f4-902c-436a-a391-adbba08873dd

📥 Commits

Reviewing files that changed from the base of the PR and between d2fb45b and 1f95f07.

📒 Files selected for processing (1)
  • packages/ui/src/components/SignUp/__tests__/SignUpStart.test.tsx

📝 Walkthrough

Walkthrough

The SignUpStartInternal code now constructs unsafeMetadata as a FormControlState-shaped object (id, value, and no-op clearFeedback, setValue, onChange, setError) before appending it to fieldsToSubmit and calling buildRequest. A regression test was added that injects unsafeMetadata, mocks signUp.create to reject with a ClerkAPIResponseError, renders SignUpStart with a ticket URL, and asserts signUp.create is called without the component throwing. A .changeset patch entry was added for @clerk/ui.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main fix: adding missing noop methods (clearFeedback, setError) to the unsafeMetadata field in SignUpStart to resolve a TypeError.
Description check ✅ Passed The description clearly explains the bug, root cause, and fix, directly relating to the code changes which add missing methods to the unsafeMetadata field.
Linked Issues check ✅ Passed The changes address the core requirement from issue #8496 by ensuring the unsafeMetadata field includes all necessary noop methods (clearFeedback, setError) that field-controller objects need, eliminating the TypeError when errors occur.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the unsafeMetadata field issue: updates to SignUpStart.tsx, addition of a regression test, and a changeset entry. No unrelated modifications are present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/ui/src/components/SignUp/__tests__/SignUpStart.test.tsx`:
- Line 492: The test uses a weak assertion
(expect(fixtures.signUp.create).toHaveBeenCalled()) which can pass before the
CardStateProvider's async error-handling (and the clearFeedback TypeError) runs;
update the test to assert a post-error side effect instead—either waitFor a
rendered error state that only appears after clearFeedback runs, or spy on
CardStateProvider's noop clearFeedback and assert that spy was called (and did
not throw); alternatively wrap the render in a helper that surfaces unhandled
promise rejections so failures in the async effect fail the test. Use
identifiers fixtures.signUp.create, CardStateProvider, and clearFeedback to
locate the code to change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 5e794e81-be7a-4db1-832e-ebbee8ca8ac1

📥 Commits

Reviewing files that changed from the base of the PR and between 18b0964 and d2fb45b.

📒 Files selected for processing (2)
  • .changeset/wild-insects-design.md
  • packages/ui/src/components/SignUp/__tests__/SignUpStart.test.tsx
✅ Files skipped from review due to trivial changes (1)
  • .changeset/wild-insects-design.md

Comment thread packages/ui/src/components/SignUp/__tests__/SignUpStart.test.tsx Outdated
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 7, 2026

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@8500

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@8500

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@8500

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@8500

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@8500

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@8500

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@8500

@clerk/express

npm i https://pkg.pr.new/@clerk/express@8500

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@8500

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@8500

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@8500

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@8500

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@8500

@clerk/react

npm i https://pkg.pr.new/@clerk/react@8500

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@8500

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@8500

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@8500

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@8500

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@8500

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@8500

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@8500

commit: 1f95f07

Copy link
Copy Markdown
Member

@bratsos bratsos left a comment

Choose a reason for hiding this comment

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

LGTM, even though 🐰 comment looks valid. Can you verify that removing your fix causes the tests to fail?

@wobsoriano
Copy link
Copy Markdown
Member Author

LGTM, even though 🐰 comment looks valid. Can you verify that removing your fix causes the tests to fail?

Addressed CR's comment 👍🏼 Added a commit that verifies removing the fix causes the test to fail

@wobsoriano wobsoriano enabled auto-merge (squash) May 7, 2026 18:07
@wobsoriano wobsoriano merged commit db3f1a9 into main May 7, 2026
73 of 74 checks passed
@wobsoriano wobsoriano deleted the rob/fix-8496 branch May 7, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Re-occurrence of #3996: TypeError "e.clearFeedback is not a function" in SignUp on Safari (clerk-js@5.125.10)

3 participants