{"record":{"id":"b72d9c9a211c850b","repo":"siyuan-note/siyuan","slug":"w-siyuan-s-or-later-is-required","errorCode":null,"errorMessage":"%w: SiYuan %s or later is required","messagePattern":"%w: SiYuan (.+?) or later is required","errorType":"exception","errorClass":"ErrLocalBazaarPackageIncompatible","httpStatus":null,"severity":"error","filePath":"kernel/model/bazaar.go","lineNumber":640,"sourceCode":"\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer cleanup()\n\n\tresult = &LocalBazaarPackageInstallResult{\n\t\tPackageType:   pkgType,\n\t\tPackageName:   pkg.Name,\n\t\tMinAppVersion: pkg.MinAppVersion,\n\t}\n\tinstallPath, _, err := getPackageInstallPath(pkgType, pkg.Name)\n\tif err != nil {\n\t\treturn result, err\n\t}\n\tif (pkgType == \"themes\" && isBuiltInTheme(pkg.Name)) || (pkgType == \"icons\" && isBuiltInIcon(pkg.Name)) {\n\t\treturn result, errors.New(\"built-in marketplace package cannot be overwritten\")\n\t}\n\tif bazaar.IsBelowRequiredAppVersion(pkg) {\n\t\treturn result, fmt.Errorf(\"%w: SiYuan %s or later is required\", ErrLocalBazaarPackageIncompatible, pkg.MinAppVersion)\n\t}\n\tif (pkgType == \"plugins\" && bazaar.IsIncompatiblePlugin(pkg, frontend)) ||\n\t\t(pkgType == \"themes\" && bazaar.IsIncompatibleTheme(pkg, frontend)) {\n\t\treturn result, ErrLocalBazaarPackageIncompatible\n\t}\n\n\tlocalBazaarInstallLock.Lock()\n\tdefer localBazaarInstallLock.Unlock()\n\tcontainsFile, statErr := bazaar.PackageDirContainsFile(installPath)\n\tif statErr != nil && !os.IsNotExist(statErr) {\n\t\treturn result, statErr\n\t}\n\tresult.Updated = containsFile\n\tif result.Updated && !overwrite {\n\t\treturn result, ErrLocalBazaarPackageExists\n\t}\n\tif err = bazaar.InstallLocalPackage(sourcePath, installPath, pkgType, pkg.Name, result.Updated); err != nil {\n\t\treturn result, fmt.Errorf(Conf.Language(46), pkg.Name, err)","sourceCodeStart":622,"sourceCodeEnd":658,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/bazaar.go#L622-L658","documentation":"InstallLocalBazaarPackage refuses packages whose declared MinAppVersion is newer than the running SiYuan, wrapping the sentinel ErrLocalBazaarPackageIncompatible with 'SiYuan <version> or later is required'. Callers can detect this case with errors.Is(err, model.ErrLocalBazaarPackageIncompatible).","triggerScenarios":"Installing a local package archive whose package.json sets minAppVersion above the current kernel version; installing an old package export into a freshly downgraded workspace.","commonSituations":"A plugin author bumped minAppVersion for a new API and users on older SiYuan try side-loading the archive; testing a package built for a dev/insider build on a stable install.","solutions":["Upgrade SiYuan to at least the required MinAppVersion shown in the error","Ask the package author to lower minAppVersion if the dependency is not actually needed","Check errors.Is(err, model.ErrLocalBazaarPackageIncompatible) in your caller to show a targeted message"],"exampleFix":"// before: treating all failures the same\nif err := model.InstallLocalBazaarPackage(zipPath, frontend, false); err != nil { return err }\n// after: detect incompatibility specifically\nif err := model.InstallLocalBazaarPackage(zipPath, frontend, false); err != nil {\n    if errors.Is(err, model.ErrLocalBazaarPackageIncompatible) {\n        return fmt.Errorf(\"please upgrade SiYuan: %v\", err)\n    }\n    return err\n}","handlingStrategy":"validation","validationCode":"pkg, _ := bazaar.ParsePackageJSON(pkgJSONPath)\nif pkg != nil && bazaar.IsBelowRequiredAppVersion(pkg) {\n  return fmt.Errorf(\"needs SiYuan >= %s\", pkg.MinAppVersion)\n}","typeGuard":null,"tryCatchPattern":"err := model.InstallLocalBazaarPackage(zip, frontend, false)\nif errors.Is(err, model.ErrLocalBazaarPackageIncompatible) {\n  return showUpgradeRequiredMessage(err)\n}","preventionTips":["Read minAppVersion from package.json before side-loading archives","Keep SiYuan updated when using newly published packages","Compare semver of the app vs package requirement in tooling"],"tags":["marketplace","version-compatibility","local-install"],"backgroundTag":"incompatible-source-type","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"}