siyuan-note/siyuan · error

image layer cannot declare a poster

Error message

image layer cannot declare a poster

What it means

Poster images are only meaningful for video layers. An image layer that declares a non-empty poster is rejected, since an image needs no preload placeholder and allowing it would be ambiguous config. The kernel treats a poster on an image layer as a manifest authoring mistake.

Solutions

  1. Remove the "poster" field (or set it to "") from image-type layers in manifest.json.
  2. Keep poster only on layers with type "video".
  3. If you intended a video, change the layer type to "video" and keep the poster.

Example fix

// before: manifest.json
{"id":"bg","type":"image","src":"bg.png","poster":"bg-thumb.png"}
// after
{"id":"bg","type":"image","src":"bg.png"}
Defensive patterns

Strategy: validation

Validate before calling

for (const l of manifest.layers) {
  if (l.type === 'image' && l.poster) throw new Error(`image layer ${l.id} must not declare poster`);
}

Type guard

function posterOnlyOnVideo(l) { return !l.poster || l.type === 'video'; }

Try / catch

try { loadAppearance(id); } catch (e) { if (/cannot declare a poster/.test(String(e))) { /* strip poster from the image layer */ } }

Prevention

When it happens

Trigger: A manifest.json layer with type "image" has a "poster" field set to a non-empty string and is loaded by GetBootAppearances/getBootAppearanceByID.

Common situations: Copy-pasting a video layer entry to make an image layer and leaving the poster field in place; a manifest generator that always emits poster; converting a video layer to image by only changing the type.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19). Data as JSON: /api/errors/1c43a06e1502f130. Report an issue: GitHub.

Appendix: source

Thrown at kernel/model/boot_appearance.go:476

		}
		layerIDs[layer.ID] = true
		if layer.Type != "image" && layer.Type != "video" {
			err = fmt.Errorf("unsupported layer type [%s]", layer.Type)
			return nil, err
		}
		if _, _, err = validateBootAppearanceResource(pluginDir, appearanceDir, layer.Src, layer.Type); err != nil {
			return nil, fmt.Errorf("invalid layer source: %w", err)
		}
		if layer.Type == "video" {
			if layer.Poster == "" {
				err = errors.New("video poster is required")
				return nil, err
			}
			if _, _, err = validateBootAppearanceResource(pluginDir, appearanceDir, layer.Poster, "image"); err != nil {
				return nil, fmt.Errorf("invalid video poster: %w", err)
			}
		} else if layer.Poster != "" {
			err = errors.New("image layer cannot declare a poster")
			return nil, err
		}
		fit := layer.Fit
		if fit == "" {
			fit = "cover"
		}
		if !isValidBootAppearanceFit(fit) {
			err = fmt.Errorf("invalid layer fit [%s]", fit)
			return nil, err
		}
		position := layer.Position
		if position == "" {
			position = "center"
		}
		if !isValidBootAppearancePosition(position) {
			err = fmt.Errorf("invalid layer position [%s]", position)
			return nil, err
		}

View on GitHub (pinned to 9f775e8a12)