Skip to content

Fix console errors - hydration from form & iframe#937

Merged
rchlfryn merged 3 commits intomainfrom
fix-form-hydration-error
Feb 13, 2026
Merged

Fix console errors - hydration from form & iframe#937
rchlfryn merged 3 commits intomainfrom
fix-form-hydration-error

Conversation

@rchlfryn
Copy link
Collaborator

@rchlfryn rchlfryn commented Feb 12, 2026

Description

Fix a React hydration error caused by the Form block generating a random UUID on each render via generateInstanceId().
Also fixes iframe error suggestion to add allow-presentation
YouTube "Watch on YouTube" button:

  • allow-popups — permits the iframe to open new windows/tabs at all
  • allow-popups-to-escape-sandbox — lets those opened windows/tabs run without inheriting the sandbox restrictions

Without allow-popups, the "Watch on YouTube" link would be blocked entirely. Without allow-popups-to-escape-sandbox, it opens but the new tab is still sandboxed, causing the error.

Related Issues

Fixes #861

Issues

Form Hydration error
Screenshot 2026-02-12 at 15 02 34
Screenshot 2026-02-12 at 15 02 45

iframe error

Screenshot 2026-02-12 at 15 02 14

Key Changes

  • Replace generateInstanceId() (which called uuidv4()) with React's useId() hook, which produces stable, SSR-safe IDs
  • Delete the now-unused generateInstanceId utility
  • Add allow-presentation and allow-popups-to-escape-sandbox to GenericEmbed

How to test

  1. Load a page with a Form block and generic embed to page
  2. Confirm no hydration mismatch warnings or iframe warnings in the console
  3. Confirm "Watch on YouTube" button opens new tab to youtube
  4. Confirm the form and embed still renders and submits correctly

Video

https://www.loom.com/share/01a2933b7559456986295cce846a0a89

@github-actions
Copy link
Contributor

Preview deployment: https://fix-form-hydration-error.preview.avy-fx.org

@rchlfryn rchlfryn added this pull request to the merge queue Feb 13, 2026
Merged via the queue into main with commit 46fd16f Feb 13, 2026
8 checks passed
@rchlfryn rchlfryn deleted the fix-form-hydration-error branch February 13, 2026 00:06
@github-actions
Copy link
Contributor

🚀 This is included in version v1.8.0

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.

Clicking on Youtube Embed redirect errors out

1 participant