{"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":null,"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/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/bazaar.go#L622-L658","documentation":"InstallLocalBazaarPackage checks bazaar.IsBelowRequiredAppVersion(pkg): if the package manifest declares a MinAppVersion higher than the running SiYuan version, it returns ErrLocalBazaarPackageIncompatible wrapped as 'SiYuan %s or later is required' via %w, preserving errors.Is compatibility. A second branch returns the bare sentinel when the plugin/theme fails the frontend compatibility check (IsIncompatiblePlugin/IsIncompatibleTheme).","triggerScenarios":"Installing a local package whose theme.json/plugin.json sets minAppVersion above the current kernel version (e.g. '3.2.0' while running 3.1.x), or whose bazaar metadata marks it incompatible with the current frontend value.","commonSituations":"Developing a plugin against the latest SiYuan and installing it in an older workspace; local packages pulled from a newer release branch; reinstalling local packages after a SiYuan downgrade; desktop-only packages attempted on mobile frontend.","solutions":["Upgrade SiYuan to the version named in the error message ('SiYuan X or later is required')","Lower the package's minAppVersion only if you have verified it actually runs on the older version","If the frontend-incompatible branch fired, use a package variant built for the current frontend (desktop/mobile)","Match on errors.Is(err, model.ErrLocalBazaarPackageIncompatible) and parse the required version from the message for a user-facing prompt"],"exampleFix":"// before: plugin.json\n{\"name\": \"my-plugin\", \"minAppVersion\": \"3.3.0\"} // running app is 3.1.9\n// after\n{\"name\": \"my-plugin\", \"minAppVersion\": \"3.1.9\"}","handlingStrategy":"try-catch","validationCode":"const appVer = siyuanVersion; // running kernel version\nconst manifest = JSON.parse(readFileSync(path.join(src, pkgType === \"plugins\" ? \"plugin.json\" : \"theme.json\"), \"utf8\"));\nif (manifest.minAppVersion && compareVersions(appVer, manifest.minAppVersion) < 0) {\n  return upgradeFirst(manifest.minAppVersion);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await model.InstallLocalBazaarPackage(src, pkgType, frontend, overwrite);\n} catch (err) {\n  if (errors.Is(err, model.ErrLocalBazaarPackageIncompatible)) {\n    // parse 'SiYuan X or later is required' from err and offer an upgrade link\n  }\n}","preventionTips":["Declare minAppVersion as the true minimum tested version, not the dev version","Test local packages against the oldest supported SiYuan release before distribution","Always match the sentinel with errors.Is so wrapped version messages still classify correctly","Keep the app updated; frontend-incompatible packages need matching desktop/mobile builds"],"tags":["marketplace","versioning","compatibility","version-constraint"],"backgroundTag":"incompatible-source-type","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}