{"record":{"id":"5e2e1a3d7d0ec9dd","repo":"siyuan-note/siyuan","slug":"errlocalbazaarpackageincompatible","errorCode":"ErrLocalBazaarPackageIncompatible","errorMessage":"marketplace package is incompatible","messagePattern":"marketplace package is incompatible","errorType":"error_code","errorClass":"ErrLocalBazaarPackageIncompatible","httpStatus":null,"severity":"error","filePath":"kernel/model/bazaar.go","lineNumber":111,"sourceCode":"}\n\n// ThemeInstallOptions 描述新安装主题后需要应用的外观模式\ntype ThemeInstallOptions struct {\n\tMode   int\n\tModeOS bool\n}\n\n// LocalBazaarPackageInstallResult 描述本地集市包的识别和安装结果。\ntype LocalBazaarPackageInstallResult struct {\n\tPackageType   string `json:\"packageType\"`\n\tPackageName   string `json:\"packageName\"`\n\tMinAppVersion string `json:\"minAppVersion,omitempty\"`\n\tUpdated       bool   `json:\"updated\"`\n}\n\nvar (\n\tErrLocalBazaarPackageExists       = errors.New(\"marketplace package already exists\")\n\tErrLocalBazaarPackageIncompatible = errors.New(\"marketplace package is incompatible\")\n\tlocalBazaarInstallLock            sync.Mutex\n)\n\n// updatePackages 更新一组集市包；同类型批量更新时，安装后处理只执行一次\nfunc updatePackages(packages []*UpdatedPackage, pkgType string, successCount, failedCount *int, planned int) {\n\titems := make([]batchInstallItem, 0, len(packages))\n\tfor _, updated := range packages {\n\t\tpkg := updated.Available\n\t\tmeta, err := installBazaarPackage(pkgType, pkg.RepoURL, pkg.RepoHash, pkg.Name)\n\t\tif err != nil {\n\t\t\tlogging.LogErrorf(\"update %s [%s] failed: %s\", pkgType, pkg.Name, err)\n\t\t\tutil.PushErrMsg(fmt.Sprintf(Conf.language(238), pkg.Name), 5000)\n\t\t\t*failedCount++\n\t\t\tcontinue\n\t\t}\n\t\titems = append(items, batchInstallItem{name: pkg.Name, meta: meta})\n\t\t*successCount++\n\t\tutil.PushEndlessProgress(fmt.Sprintf(Conf.language(236), *successCount+*failedCount, planned, pkg.Name))","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/bazaar.go#L93-L129","documentation":"Sentinel error ErrLocalBazaarPackageIncompatible, returned by InstallLocalBazaarPackage when the package is incompatible with the running app: either the package's MinAppVersion is above the current app version (also wrapped with the required version, see error 496), or for plugins/themes the frontend/backend compatibility check (bazaar.IsIncompatiblePlugin / IsIncompatibleTheme) fails. It is also used as a wrapping base for the version-required message.","triggerScenarios":"Installing a local plugin or theme whose manifest declares a MinAppVersion higher than the running SiYuan build, or whose declared backend/frontend target does not match the current frontend (e.g. a desktop-only plugin on mobile).","commonSituations":"User downloaded a package built for a newer SiYuan than they run, or a plugin targeting a different frontend. Common after a SiYuan downgrade or when sideloading a package from another device.","solutions":["Update SiYuan to at least the package's MinAppVersion and retry the install.","If the package targets a different frontend (mobile vs desktop), install it on the matching frontend.","Check errors.Is(err, model.ErrLocalBazaarPackageIncompatible) and surface the required version to the user."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Pre-check version and frontend compatibility before installing.\nif bazaar.IsBelowRequiredAppVersion(pkg) {\n    return fmt.Errorf(\"requires SiYuan %s or later\", pkg.MinAppVersion)\n}\nif pkgType == \"plugins\" && bazaar.IsIncompatiblePlugin(pkg, frontend) {\n    return errors.New(\"incompatible plugin for this frontend\")\n}\nif pkgType == \"themes\" && bazaar.IsIncompatibleTheme(pkg, frontend) {\n    return errors.New(\"incompatible theme for this frontend\")\n}","typeGuard":null,"tryCatchPattern":"_, err := model.InstallLocalBazaarPackage(archivePath, frontend, overwrite)\nif err != nil {\n    if errors.Is(err, model.ErrLocalBazaarPackageIncompatible) {\n        // tell the user which version/frontend is required\n    }\n}","preventionTips":["Check MinAppVersion against util.Ver before attempting install.","Verify frontend compatibility (IsIncompatiblePlugin/IsIncompatibleTheme) for plugins and themes.","Surface the required version in the UI when this sentinel is returned."],"tags":["bazaar","package-management","version-compat","sentinel-error"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}