{"record":{"id":"751ef7f4a2f604bd","repo":"siyuan-note/siyuan","slug":"invalid-type","errorCode":null,"errorMessage":"invalid type","messagePattern":"invalid type","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/config/entryVisibility/ui.ts","lineNumber":910,"sourceCode":"    }\n};\n\nconst importProfiles = async (root: HTMLElement, file: File) => {\n    if (!getHostCapabilities().importExport) {\n        return;\n    }\n    try {\n        const data = JSON.parse(await file.text()) as TImportFile;\n        if (!isEntryVisibilityImportVersionSupported(data.version, ENTRY_VISIBILITY_VERSION)) {\n            throw new Error(\"unsupported version\");\n        }\n        let imported: TEntryVisibilityImportProfile[];\n        if (data.type === \"siyuan-entry-profile\" && data.profile) {\n            imported = [data.profile];\n        } else if (data.type === \"siyuan-entry-profile-bundle\" && Array.isArray(data.profiles)) {\n            imported = data.profiles;\n        } else {\n            throw new Error(\"invalid type\");\n        }\n        const config = cloneConfig();\n        let importedCount = 0;\n        imported.forEach((item) => {\n            const profile = normalizeEntryVisibilityImportProfile(item, data.version, createEntryOrderSnapshot());\n            if (!profile) {\n                return;\n            }\n            config.profiles.push({\n                id: genUUID(),\n                name: uniqueName(profile.name, config.profiles),\n                entries: profile.entries,\n                orders: profile.orders,\n            });\n            importedCount++;\n        });\n        if (imported.length > 0 && importedCount === 0) {\n            throw new Error(\"invalid profiles\");","sourceCodeStart":892,"sourceCodeEnd":928,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/app/src/config/entryVisibility/ui.ts#L892-L928","documentation":"Thrown during profile import when data.type is neither \"siyuan-entry-profile\" nor \"siyuan-entry-profile-bundle\" (or a bundle lacks data.profiles): the file parsed and its version is supported, but it is not an entry-visibility profile export at all — likely an unrelated JSON file.","triggerScenarios":"Thrown at app/src/config/entryVisibility/ui.ts:910 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the file was exported via the entry-visibility profile import/export UI","Check the file's type field matches \"siyuan-entry-profile\" or \"siyuan-entry-profile-bundle\"","Re-export the profile from the correct settings panel"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}