Errors and warnings

Import reports, syntax errors, stale revisions and recovery.

1.0.0-beta.6 · Local build · desktop

Import reports

ImportReport describes accepted changes, warnings and unsupported formatting. ContentImportError signals a rejected import; allowLossy confirms supported cleanup/formatting loss but does not disable sanitization. The interface explains a localized reason rather than raw internal tags.

CSS and source

CSSValidationError rejects the whole stylesheet/application pair. Incorrect tag nesting or fenced Markdown blocks preserve the last valid document and block mode switching. Fix or reset the source draft. Getters continue to return the applied version.

Async operations

StaleDocumentError protects delayed edits/uploads against newer revisions. AbortError reports cancellation. Loading failures usually mean a missing/stale source.js/codecs.js or chunk; deploy the full matching distribution. Await readiness and catch rejected operations.

Cleanup

Invalid configurations and duplicate/unavailable plugins throw. A destroy cleanup failure may produce AggregateError after resources have been released. Present useful recovery in your application instead of discarding content. Troubleshooting, security.

import { ContentImportError } from '@vitext-ru/editor';
try {
  await editor.setContent(incomingHTML);
} catch (error) {
  if (error instanceof ContentImportError) {
    console.log(error.report.warnings);
    // await editor.setContent(incomingHTML, { allowLossy: true });
  } else throw error;
}

Search documentation

No results. Try different words.

All documentation