Skip to Content
SumX EditorTroubleshooting

Troubleshooting

Common issues when integrating @sumx/sumx-editor in Next.js and the SumX portal.

Cannot find module 'suneditor/...' during SSR or build

Cause: SunEditor is imported on the server graph (static import of suneditor or sumx-editor-core).

Fix:

  • Import only @sumx/sumx-editor (default shell), never sumx-editor-core directly.
  • For route splitting: dynamic(() => import('@sumx/sumx-editor'), { ssr: false }).
  • Do not add suneditor to server bundles for RSC paths.

The package loads core in useEffect specifically to avoid this.


Editor styles missing / unstyled toolbar

Cause: styles.scss not imported or Tailwind not scanning kit classes.

Fix:

/* globals.scss */ @import '@sumx/sumx-editor/styles.scss';
/* tailwind.css */ @source "../../node_modules/@sumx/sumx-editor/dist"; @source "../../node_modules/@sumx/sumx-editor/src";

Restart dev server after changing @source.


Gray borders look wrong / default Tailwind zinc

Cause: Host theme not applied; kit uses portal tokens (border-gray-gray, text-black-soft).

Fix: Ensure portal tailwind.config.js defines gray.gray, gray.lighter, black.soft, etc., and @source includes @sumx/sumx-editor.


Input is not exported from '@sumx/ui'

Cause: @sumx/ui older than 0.1.2.

Fix:

pnpm run sumx:feed # or bump sumx-deps.config.json feedVersions["@sumx/ui"] to 0.1.2 pnpm install

@sumx/sumx-editor depends on UI for Input, Label, Slider, DropdownMenu.


Variables picker empty

Check:

  • variableGroups has at least one group with options.length > 0
  • variablesEnabled is not false
  • disabled / readOnly not blocking picker

Image crop dialog does not open

Check:

  • showImageButton={true}
  • onImageUploadBefore from useSumxEditorImageCropUploadBefore() or custom handler
  • react-easy-crop installed (peer)
  • @sumx/ui Dialog available (permission provider not required for dialog itself)

onChange not firing / stale value in forms

Check:

  • Controlled value + onChange wired to form state
  • For RHF: use Controller, not uncontrolled defaultValue only
  • setContents via ref does not fire onChange when content unchanged (by design)

HTML stripped after save

Expected for forbidden tags/attrs. Compare with Sanitization. If legitimate markup is removed, request a security-reviewed change to RICH_HTML_SANITIZE_CONFIG — do not bypass sanitization in the portal.


Feed install: package not found

Fix:

  1. Publish @sumx/sumx-editor@0.1.0 and @sumx/ui@0.1.2 to Azure Artifacts
  2. Or pnpm run sumx:local / sumx:vendor for dev
  3. pnpm run auth:azure:check when using feed

Local kit changes not reflected

cd sumx-ssr-kit && pnpm --filter @sumx/sumx-editor run build cd sumx-client-portal && pnpm dev

sumx:local rebuilds kit packages before linking.