{"record":{"id":"6b690d53e1f90ce9","repo":"babalae/better-genshin-impact","slug":"manifest-json-js-manifestfile","errorCode":null,"errorMessage":"manifest.json文件不存在，请确认此脚本是JS脚本类型。{ManifestFile}","messagePattern":"manifest\\.json文件不存在，请确认此脚本是JS脚本类型。(.+?)","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/Core/Script/Project/ScriptProject.cs","lineNumber":41,"sourceCode":"    public string ManifestFile { get; set; }\n\n    public Manifest Manifest { get; set; }\n\n    public string FolderName { get; set; }\n\n    public ScriptProject(string folderName)\n    {\n        FolderName = folderName;\n        ProjectPath = Path.Combine(Global.ScriptPath(), folderName);\n        if (!Directory.Exists(ProjectPath))\n        {\n            throw new DirectoryNotFoundException(\"脚本文件夹不存在:\" + ProjectPath);\n        }\n\n        ManifestFile = Path.GetFullPath(Path.Combine(ProjectPath, \"manifest.json\"));\n        if (!File.Exists(ManifestFile))\n        {\n            throw new FileNotFoundException(\"manifest.json文件不存在，请确认此脚本是JS脚本类型。\" + ManifestFile);\n        }\n\n        Manifest = Manifest.FromJson(File.ReadAllText(ManifestFile));\n        Manifest.Validate(ProjectPath);\n    }\n\n    public ScrollViewer? LoadSettingUi(dynamic context)\n    {\n        var settingItems = Manifest.LoadSettingItems(ProjectPath);\n        if (settingItems.Count == 0)\n        {\n            return null;\n        }\n\n        var stackPanel = new StackPanel\n        {\n            Margin = new Thickness(0, 0, 20, 0) // 给右侧滚动条留出位置\n        };","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/Core/Script/Project/ScriptProject.cs#L23-L59","documentation":"Thrown by the ScriptProject constructor when the project directory exists but manifest.json is missing from it. This is a FileNotFoundException indicating the folder is not a valid JS script project. The message suggests verifying the script type, since non-JS folders (like KeyMouse or Pathing) don't have manifest.json.","triggerScenarios":"Constructing new ScriptProject(folderName) where the directory exists but Path.Combine(ProjectPath, 'manifest.json') does not. The folder might be a different script type (Pathing JSON, KeyMouse) or an incomplete JS project.","commonSituations":"A ScriptGroupProject of Type 'Javascript' points to a folder that is actually a Pathing or KeyMouse script folder. The manifest.json was deleted or never created. The folder was created but the script was never fully set up. Confusing script types in configuration.","solutions":["Verify the folder is actually a JS script project (should contain manifest.json and a main JS file).","If the folder is a different type, fix the ScriptGroupProject.Type accordingly.","Create or restore the manifest.json file in the project folder.","Remove the invalid project entry from the script group configuration."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"string manifestFile = Path.Combine(projectPath, \"manifest.json\");\nif (!File.Exists(manifestFile))\n    throw new FileNotFoundException($\"manifest.json not found at: {manifestFile}\");","typeGuard":"static bool IsJavascriptProject(string folderName)\n{\n    var path = Path.Combine(Global.ScriptPath(), folderName, \"manifest.json\");\n    return File.Exists(path);\n}","tryCatchPattern":"try\n{\n    var project = new ScriptProject(folderName);\n}\ncatch (FileNotFoundException ex) when (ex.Message.Contains(\"manifest.json文件不存在\"))\n{\n    TaskControl.Logger.LogError(\"Not a valid JS script project: {Message}\", ex.Message);\n}","preventionTips":["Confirm the folder is a JS project type before constructing ScriptProject.","Ensure manifest.json is present in every JS script package.","Validate script type matches the folder contents."],"tags":["script-project","file-not-found","manifest","initialization"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}