{"record":{"id":"70e9adead185390c","repo":"spicetify/cli","slug":"unrecognized-theme-assets-kind-only-root-fold","errorCode":null,"errorMessage":"unrecognized theme assets kind. only \"root\", \"folder\", \"color\", \"css\", \"js\" or \"assets\" is valid","messagePattern":"unrecognized theme assets kind\\. only \"root\", \"folder\", \"color\", \"css\", \"js\" or \"assets\" is valid","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/path.go","lineNumber":37,"sourceCode":"\t}\n\n\tif kind == \"folder\" {\n\t\treturn themeFolder, nil\n\t} else if kind == \"color\" {\n\t\tcolor := filepath.Join(themeFolder, \"color.ini\")\n\t\treturn color, nil\n\t} else if kind == \"css\" {\n\t\tcss := filepath.Join(themeFolder, \"user.css\")\n\t\treturn css, nil\n\t} else if kind == \"js\" {\n\t\tjs := filepath.Join(themeFolder, \"theme.js\")\n\t\treturn js, nil\n\t} else if kind == \"assets\" {\n\t\tassets := filepath.Join(themeFolder, \"assets\")\n\t\treturn assets, nil\n\t}\n\n\treturn \"\", errors.New(`unrecognized theme assets kind. only \"root\", \"folder\", \"color\", \"css\", \"js\" or \"assets\" is valid`)\n}\n\n// ThemeAllAssetsPath returns paths of all theme's assets\nfunc ThemeAllAssetsPath() (string, error) {\n\tInitSetting()\n\n\tif len(themeFolder) == 0 {\n\t\treturn \"\", errors.New(`config \"current_theme\" is blank`)\n\t}\n\n\tresults := []string{\n\t\tthemeFolder,\n\t\tfilepath.Join(themeFolder, \"color.ini\"),\n\t\tfilepath.Join(themeFolder, \"user.css\"),\n\t\tfilepath.Join(themeFolder, \"theme.js\"),\n\t\tfilepath.Join(themeFolder, \"assets\")}\n\n\treturn strings.Join(results, \"\\n\"), nil","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/spicetify/cli/blob/1f13f736163165234eef4fb792a03f9b5b732aa4/src/cmd/path.go#L19-L55","documentation":"ThemeAssetPath only recognizes the kinds \"root\", \"folder\", \"color\", \"css\", \"js\" and \"assets\". Any other kind string falls through all branches and returns this error from src/cmd/path.go, acting as a strict enum guard on the kind parameter.","triggerScenarios":"Calling ThemeAssetPath with a misspelled or unsupported kind such as \"Color\", \"styles\", \"cssfile\", or an empty string — i.e. the kind matched none of the six literal comparisons in the function.","commonSituations":"Programmatic callers passing user-supplied kind values without normalization; case-sensitivity mistakes (\"CSS\"); calling with \"path\" or \"all\" expecting an alias that does not exist.","solutions":["Pass exactly one of: root, folder, color, css, js, assets (lowercase)","Normalize/validate the kind string before calling","For all theme asset paths at once, use ThemeAllAssetsPath instead"],"exampleFix":"// before\npath, err := cmd.ThemeAssetPath(\"CSS\")\n// after\npath, err := cmd.ThemeAssetPath(\"css\")","handlingStrategy":"validation","validationCode":"validKinds := map[string]bool{\"root\": true, \"folder\": true, \"color\": true, \"css\": true, \"js\": true, \"assets\": true}\nk := strings.ToLower(kind)\nif !validKinds[k] {\n    return fmt.Errorf(\"kind must be one of root, folder, color, css, js, assets; got %q\", kind)\n}","typeGuard":"type ThemeAssetKind string\nfunc (k ThemeAssetKind) valid() bool {\n    switch k {\n    case \"root\", \"folder\", \"color\", \"css\", \"js\", \"assets\":\n        return true\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Pass kind strings lowercase and exactly as documented","Centralize kind values in a constant/enum in calling code","Normalize user input (ToLower/TrimSpace) before calling ThemeAssetPath"],"tags":["invalid-argument","theme","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"1f13f736163165234eef4fb792a03f9b5b732aa4","analyzedAt":"2026-08-31T18:57:59.754Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}