siyuan-note/siyuan · error

marketplace package manifest not found

Error message

marketplace package manifest not found

What it means

ExtractLocalPackage requires a recognized marketplace manifest (plugin.json, theme.json, icon.json, template.json, or widget.json) at the archive root or in its single top-level directory. When none of these regular files exists anywhere in the allowed root, it throws this error and cleans up the temp directory.

Solutions

  1. Place a valid manifest (plugin.json/theme.json/icon.json/template.json/widget.json) at the archive root
  2. Or keep exactly one top-level directory containing the manifest at its root
  3. Ensure the manifest filename casing matches exactly
  4. Re-zip from the directory that directly contains the manifest

Example fix

// before: archive(zip)/my-plugin/build/my-plugin/plugin.json (two levels)
// after: archive(zip)/my-plugin/plugin.json
Defensive patterns

Strategy: validation

Validate before calling

const manifests = ["plugin.json","theme.json","icon.json","template.json","widget.json"];
const hasManifest = manifests.some(f => fs.existsSync(path.join(pkgRoot, f)));
if (!hasManifest) throw new Error("no marketplace manifest at archive root (or its single top-level dir)");

Try / catch

try { await installLocalPackage(zipPath); } catch (e) { if (String(e).includes("manifest not found")) { /* guide user to add plugin.json */ } else throw e; }

Prevention

When it happens

Trigger: Calling ExtractLocalPackage on a zip lacking any of the five manifest names, or where the manifest sits in a nested directory deeper than one level (localPackageRoot only descends one level).

Common situations: Packaging the wrong directory (source root without manifest); zipping a parent folder so the manifest ends up two levels deep; uploading a plain asset zip instead of a built package; typo like Plugin.json.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19). Data as JSON: /api/errors/3b68595da816d8f3. Report an issue: GitHub.

Appendix: source

Thrown at kernel/bazaar/local.go:76

		cleanup()
		return
	}

	var manifestPath string
	for manifestName, packageType := range localPackageManifests {
		candidate := filepath.Join(packagePath, manifestName)
		if info, statErr := os.Stat(candidate); statErr == nil && info.Mode().IsRegular() {
			if manifestPath != "" {
				err = errors.New("multiple marketplace package manifests found")
				cleanup()
				return
			}
			pkgType = packageType
			manifestPath = candidate
		}
	}
	if manifestPath == "" {
		err = errors.New("marketplace package manifest not found")
		cleanup()
		return
	}

	pkg, err = ParsePackageJSON(manifestPath)
	if err != nil || pkg == nil {
		err = errors.New("invalid marketplace package manifest")
		cleanup()
	}
	return
}

func extractLocalPackageArchive(archivePath, destination string) error {
	reader, err := zip.OpenReader(archivePath)
	if err != nil {
		return errors.New("invalid marketplace package archive")
	}
	defer reader.Close()

View on GitHub (pinned to 9f775e8a12)