Skip to content

[lexical-website] Bug Fix: Drop Vercel Analytics inject and unwrap chat input from flex parent#8509

Merged
etrepum merged 2 commits into
facebook:mainfrom
mayrang:fix/8103-website-console-errors
May 14, 2026
Merged

[lexical-website] Bug Fix: Drop Vercel Analytics inject and unwrap chat input from flex parent#8509
etrepum merged 2 commits into
facebook:mainfrom
mayrang:fix/8103-website-console-errors

Conversation

@mayrang
Copy link
Copy Markdown
Contributor

@mayrang mayrang commented May 13, 2026

Description

Two of the console errors reported in #8103 originate from this repo and can be fixed here. The third (staticdocs.thefacebook.com/ping failing to resolve, twice per navigation) is emitted by docusaurus-plugin-internaldocs-fb's internaldocsSetRedirect and has no opt-out in the preset config, so it's out of scope for this PR.

Lexical's flex + contentEditable warning

examples/website-chat/src/ChatInput.tsx had <ContentEditable> as a direct child of a flex row alongside <EmojiPlugin /> and the send button. LexicalEditor.setRootElement's dev-only check warns whenever the editor root's immediate parent computes to display: flex or inline-flex. Wrap the editable in a non-flex <div className="min-w-0 flex-1"> so the immediate parent is display: block. flex-1 min-w-0 on the wrapper preserves the original flex sizing for the input row.

Vercel Analytics 404

packages/lexical-website/src/pages/index.tsx calls inject() from @vercel/analytics on every page load, but /_vercel/insights/script.js returns 404 on the deployed site (Web Analytics isn't enabled on the Vercel project). This PR drops the import, the call, and the dependency, which is the simplest way to quiet the error without Vercel project access.

If the intent is actually to keep Vercel Analytics and enable it on the Vercel side, happy to revert this part — let me know.

Out of scope

staticdocs.thefacebook.com/ping fires from docusaurus-plugin-internaldocs-fb/module.js (NETWORK_TEST_URL constant, no plugin option to disable). Removing it would mean either patching the Meta-internal plugin or swapping presets, both larger than this PR.

Closes #8103 partially.

Test plan

  • pnpm --filter @lexical/website docusaurus start — homepage loads, console no longer shows the Vercel Analytics 404 or the [Vercel Web Analytics] Failed to load script follow-up.
  • Same dev server — focused and clicked across the chat input on the homepage; Lexical's display: flex warning no longer fires.
  • Chat input layout unchanged in DevTools (emoji button + input + send button stay on the same row, input still fills available space).
  • staticdocs.thefacebook.com/ping ×2 still present as expected (Meta-internal plugin, see Out of scope).
  • tsc / prettier / eslint clean.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 13, 2026

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

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview, Comment May 14, 2026 5:21pm
lexical-playground Ready Ready Preview, Comment May 14, 2026 5:21pm

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 13, 2026
@etrepum etrepum added the extended-tests Run extended e2e tests on a PR label May 13, 2026
@etrepum etrepum added this pull request to the merge queue May 14, 2026
Merged via the queue into facebook:main with commit 12b73c7 May 14, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. extended-tests Run extended e2e tests on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Errors appear in the browser console immediately on lexical.dev page load

2 participants