{"record":{"id":"324fd9cd78b11d4c","repo":"siyuan-note/siyuan","slug":"unsupported-layer-type-s","errorCode":null,"errorMessage":"unsupported layer type [%s]","messagePattern":"unsupported layer type \\[(.+?)\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/boot_appearance.go","lineNumber":461,"sourceCode":"\tret.OfficialUI.ProgressColor = manifest.OfficialUI.ProgressColor\n\tret.OfficialUI.TrackColor = manifest.OfficialUI.TrackColor\n\n\tif manifest.Style != \"\" {\n\t\tif _, _, err = validateBootAppearanceResource(pluginDir, appearanceDir, manifest.Style, \"style\"); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid style: %w\", err)\n\t\t}\n\t\tret.Style = bootAppearanceAssetURL(pkg.Name, appearanceID, manifest.Style)\n\t}\n\n\tlayerIDs := map[string]bool{}\n\tfor _, layer := range manifest.Layers {\n\t\tif layer == nil || !isValidBootAppearanceID(layer.ID) || layerIDs[layer.ID] {\n\t\t\terr = errors.New(\"invalid or duplicate layer ID\")\n\t\t\treturn nil, err\n\t\t}\n\t\tlayerIDs[layer.ID] = true\n\t\tif layer.Type != \"image\" && layer.Type != \"video\" {\n\t\t\terr = fmt.Errorf(\"unsupported layer type [%s]\", layer.Type)\n\t\t\treturn nil, err\n\t\t}\n\t\tif _, _, err = validateBootAppearanceResource(pluginDir, appearanceDir, layer.Src, layer.Type); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid layer source: %w\", err)\n\t\t}\n\t\tif layer.Type == \"video\" {\n\t\t\tif layer.Poster == \"\" {\n\t\t\t\terr = errors.New(\"video poster is required\")\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif _, _, err = validateBootAppearanceResource(pluginDir, appearanceDir, layer.Poster, \"image\"); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid video poster: %w\", err)\n\t\t\t}\n\t\t} else if layer.Poster != \"\" {\n\t\t\terr = errors.New(\"image layer cannot declare a poster\")\n\t\t\treturn nil, err\n\t\t}\n\t\tfit := layer.Fit","sourceCodeStart":443,"sourceCodeEnd":479,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/boot_appearance.go#L443-L479","documentation":"Boot appearance layers only support the types \"image\" and \"video\". Any other layer.type value in the manifest is rejected with this error so the kernel never has to render an unknown media kind at boot.","triggerScenarios":"A manifest.json layer entry has \"type\" set to something other than image or video (e.g. \"text\", \"gif\", \"webm\", \"lottie\", or a capitalized \"Image\").","commonSituations":"Author assuming GIF or Lottie animations are supported as a layer type; a typo or wrong-case type value; copying a layer schema from another plugin system with richer layer kinds; manifest authored for a newer spec that introduced new types not supported by the installed kernel.","solutions":["Set layer \"type\" to exactly \"image\" or \"video\" (lowercase).","Convert unsupported media (e.g. GIF) into a supported image/video format before referencing it.","If you need richer layers, implement the effect inside the style/asset itself rather than as a separate layer type.","Check the installed kernel's supported set in loadBootAppearance before adding new types."],"exampleFix":"// before: manifest.json\n{\"id\":\"anim\",\"type\":\"lottie\",\"src\":\"anim.json\"}\n// after\n{\"id\":\"anim\",\"type\":\"video\",\"src\":\"anim.mp4\",\"poster\":\"anim.png\"}","handlingStrategy":"validation","validationCode":"const ALLOWED = ['image', 'video'];\n(manifest.layers || []).forEach(l => { if (!ALLOWED.includes(l.type)) throw new Error(`unsupported layer type: ${l.type}`); });","typeGuard":"function isSupportedLayer(l) { return l.type === 'image' || l.type === 'video'; }","tryCatchPattern":"try { loadAppearance(id); } catch (e) { if (/unsupported layer type/.test(String(e))) { /* convert the layer to image or video */ } }","preventionTips":["Only use lowercase 'image' or 'video' as layer types","Do not assume GIF/Lottie layers are supported","Validate manifests in CI against the allowed type enum"],"tags":["boot-appearance","layers","enum","unsupported-type"],"backgroundTag":"invalid-enum-value","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}