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), neversumx-editor-coredirectly. - For route splitting:
dynamic(() => import('@sumx/sumx-editor'), { ssr: false }). - Do not add
suneditorto 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:
variableGroupshas at least one group withoptions.length > 0variablesEnabledis notfalsedisabled/readOnlynot blocking picker
Image crop dialog does not open
Check:
showImageButton={true}onImageUploadBeforefromuseSumxEditorImageCropUploadBefore()or custom handlerreact-easy-cropinstalled (peer)@sumx/uiDialogavailable (permission provider not required for dialog itself)
onChange not firing / stale value in forms
Check:
- Controlled
value+onChangewired to form state - For RHF: use
Controller, not uncontrolleddefaultValueonly setContentsvia ref does not fireonChangewhen 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:
- Publish
@sumx/sumx-editor@0.1.0and@sumx/ui@0.1.2to Azure Artifacts - Or
pnpm run sumx:local/sumx:vendorfor dev pnpm run auth:azure:checkwhen using feed
Local kit changes not reflected
cd sumx-ssr-kit && pnpm --filter @sumx/sumx-editor run build
cd sumx-client-portal && pnpm devsumx:local rebuilds kit packages before linking.