siyuan-note/siyuan · error

invalid video poster

Error message

invalid video poster: %w

What it means

The poster declared on a video layer is validated with validateBootAppearanceResource using the "image" type: it must exist inside the appearance directory, be a symlink-free relative path, have an image extension, and respect size limits. Failures are wrapped as "invalid video poster".

Solutions

  1. Ensure the poster file exists in the appearance directory and is included in the package.
  2. Make the poster a relative path to an actual image file (.png/.jpg etc.), not a video or document.
  3. Compress the poster image if it exceeds the resource size limit.

Example fix

// before: manifest.json
{"id":"intro","type":"video","src":"intro.mp4","poster":"intro.mp4"}
// after
{"id":"intro","type":"video","src":"intro.mp4","poster":"intro.png"}
Defensive patterns

Strategy: validation

Validate before calling

for (const l of manifest.layers) {
  if (l.type === 'video' && l.poster) {
    const p = path.resolve(appearanceDir, l.poster);
    if (!fs.existsSync(p) || !/\.(png|jpe?g|webp)$/i.test(l.poster)) throw new Error('bad poster: ' + l.poster);
  }
}

Try / catch

try { loadAppearance(id); } catch (e) { if (/invalid video poster/.test(String(e))) { /* point poster at a real, in-directory image file */ } }

Prevention

When it happens

Trigger: A video layer's poster path in manifest.json references a missing file, escapes the appearance directory, uses a non-image extension (e.g. .mp4), or exceeds the size limit.

Common situations: Poster image not packaged with the plugin; poster path typo; pointing the poster at the video file itself; oversized poster screenshot from a retina capture.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


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

Appendix: source

Thrown at kernel/model/boot_appearance.go:473

		if layer == nil || !isValidBootAppearanceID(layer.ID) || layerIDs[layer.ID] {
			err = errors.New("invalid or duplicate layer ID")
			return nil, err
		}
		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) {

View on GitHub (pinned to 9f775e8a12)