dotCMS / dotCMS/core

[React SDK]: `<DotCMSLayoutBody />` Incorrectly Loads TinyMCE at Runtime (SSR Crash)

Open
#32,418 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Team : Scout Type : Defect
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Problem Statement

When using <DotCMSLayoutBody /> in a server-side context (e.g., during SSR in a Next.js app), the build/runtime fails due to TinyMCE being loaded into the bundle, even though TinyMCE should only run on the client.

This is not just a misleading error; it's a real bug:
TinyMCE (a browser-only dependency) is being included and evaluated during SSR, which causes the crash.

Steps to Reproduce
  1. Open the Next.js SDK example
  2. Use <DotCMSLayoutBody /> in a server-rendered page.
  3. Observe a runtime crash related to TinyMCE.

Image

Expected Behavior
  • TinyMCE should never be included or evaluated in the server-side runtime.
  • Any client-only code depending on TinyMCE should be lazily loaded or wrapped in dynamic imports with ssr: false.
  • If <DotCMSLayoutBody /> is not SSR-safe, the crash should relate to that; not a dependency like TinyMCE leaking into the server context.
Acceptance Criteria
  • [ ] TinyMCE is not loaded at runtime unless the component is rendering in the browser.
  • [ ] All TinyMCE-related components are tree-shaken or conditionally loaded.
  • [ ] <DotCMSLayoutBody /> does not crash during SSR due to TinyMCE inclusion.
  • [ ] Confirm the SDK works in Next.js server + client environments as expected.
Affected Version
Proposed Objective

User Experience

Proposed Priority

Priority 3 – Average

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Next.js SDK example and the entry point, then trace where TinyMCE enters the server bundle. Done means TinyMCE is not loaded or evaluated during SSR, the component no longer crashes in the stated server-rendered scenario, and the SDK works in Next.js server and client environments.

Written by the indexing model from the issue text.

Assessment

Tech stack
next.js, react
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.