{"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/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/boot_appearance.go#L443-L479","documentation":"loadBootAppearance rejects a boot-appearance manifest whose style layer type is not one of the supported layer kinds. Unknown layer type strings in the manifest's Layers array fail this format check while loading an appearance package.","triggerScenarios":"GetBootAppearances/getBootAppearanceByID loading a manifest.json where some layer's type is missing, misspelled (e.g. \"Image\", \"img\", \"gif\"), or a new experimental type not supported by the running kernel version.","commonSituations":"Manifest authored against a hypothetical/patched kernel that allows other layer types; typo 'type': 'image ' with trailing space; author assumed GIF/WebM layers work; type field omitted when constructing the layer object.","solutions":["Set each layer's type to exactly \"image\" or \"video\"","Change unsupported media (GIF/WebM) to an accepted format: convert GIF to .png/.jpg/.webp image or WebM to .mp4 video","Update the plugin/kernel so both sides agree on supported layer types","Remove layers with invalid types if they are not needed"],"exampleFix":"// before\n{\"id\": \"logo\", \"type\": \"gif\", \"src\": \"logo.gif\"}\n// after\n{\"id\": \"logo\", \"type\": \"image\", \"src\": \"logo.webp\"}","handlingStrategy":"validation","validationCode":"const ALLOWED_TYPES = new Set([\"image\", \"video\"]);\nmanifest.layers?.forEach(l => {\n  if (!ALLOWED_TYPES.has(l.type)) throw new Error(`layer ${l.id}: type must be \"image\" or \"video\"`);\n});","typeGuard":"const isLayerType = (t: unknown): t is \"image\" | \"video\" => t === \"image\" || t === \"video\";","tryCatchPattern":null,"preventionTips":["Use only the literal strings \"image\" and \"video\" for layer type","Convert GIF/WebM assets to accepted formats (webp/png/jpg, mp4) at build time","Type the layer type as a union in your manifest typings so typos fail compilation","Avoid trailing whitespace when editing manifests by hand"],"tags":["validation","enum","plugin","manifest"],"backgroundTag":"unsupported-enum-value","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}