toeverything/AFFiNE · error

Cannot find render flavour ${flavour}.

Error message

Cannot find render flavour ${flavour}.

What it means

Warning logged in EditorHost's `_renderModel` when either the schema or the view for a model's flavour is missing from the registries — the flavour is unregistered (plugin not loaded or doc contains a flavour this build doesn't know). The model renders as `nothing`, skipping only that block; the rest of the doc still renders.

Source

Thrown at blocksuite/framework/std/src/view/element/lit-host.ts:71

  static override styles = css`
    editor-host {
      outline: none;
      isolation: isolate;
      display: block;
      height: 100%;
    }
  `;

  private readonly _renderModel = (model: BlockModel): TemplateResult => {
    const { flavour } = model;
    const block = this.store.getBlock(model.id);
    if (!block || block.blockViewType === 'hidden') {
      return html`${nothing}`;
    }
    const schema = this.store.schema.flavourSchemaMap.get(flavour);
    const view = this.std.getView(flavour);
    if (!schema || !view) {
      console.warn(`Cannot find render flavour ${flavour}.`);
      return html`${nothing}`;
    }

    const widgetViews = this.std.provider.getAll(WidgetViewIdentifier);
    const widgets = Array.from(widgetViews.entries()).reduce(
      (mapping, [key, tag]) => {
        const [widgetFlavour, id] = key.split('|');
        if (isMatchFlavour(widgetFlavour, model)) {
          const template = html`<${tag} ${unsafeStatic(WIDGET_ID_ATTR)}=${id}></${tag}>`;
          mapping[id] = template;
        }
        return mapping;
      },
      {} as Record<string, TemplateResult>
    );

    const tag = typeof view === 'function' ? view(model) : view;
    return html`<${tag}

View on GitHub (pinned to b4c8548c09)

Solutions

  1. Register a renderer for the flavour.
  2. Check the flavour name in the view spec.
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Triggered when the lit host renderer cannot find a schema or view for a block's flavour, rendering nothing for that block.

Common situations: Occurs when a doc contains blocks of an unregistered flavour, typically from missing extensions or cross-version content. The block renders empty; ensure all block extensions are loaded.


AI-assisted analysis of toeverything/AFFiNE@b4c8548c09 (2026-08-18). Data as JSON: /api/errors/cdba6f6bc6ddb7f2. Report an issue: GitHub.