GopeedLab/gopeed · error

manifest.json not found

Error message

manifest.json not found

What it means

ErrExtensionNoManifest is returned by parseExtensionByPath when the target folder has no manifest.json at its root. The folder is either the local path given to InstallExtensionByFolder or the git clone temp dir joined with the sub-path parsed from an install URL (github.com/<user>/<repo>/tree/<ref>/<subdir>). It is the first check of extension installation, so any structural mistake in the repo layout fails here.

Source

Thrown at pkg/download/extension.go:33

	"github.com/GopeedLab/gopeed/pkg/base"
	"github.com/GopeedLab/gopeed/pkg/download/engine"
	gojaerror "github.com/GopeedLab/gopeed/pkg/download/engine/inject/error"
	gojautil "github.com/GopeedLab/gopeed/pkg/download/engine/util"
	enginewebview "github.com/GopeedLab/gopeed/pkg/download/engine/webview"
	"github.com/GopeedLab/gopeed/pkg/util"
	"github.com/dop251/goja"
	"github.com/go-git/go-git/v5"
	"github.com/go-git/go-git/v5/plumbing/transport"
)

var (
	gitSuffix = ".git"

	tempExtensionsDir   = ".extensions"
	extensionsDir       = "extensions"
	extensionIgnoreDirs = []string{gitSuffix, "node_modules"}

	ErrExtensionNoManifest = fmt.Errorf("manifest.json not found")
	ErrExtensionNotFound   = fmt.Errorf("extension not found")
)

type ActivationEvent string

const (
	EventOnResolve ActivationEvent = "onResolve"
	EventOnStart   ActivationEvent = "onStart"
	EventOnError   ActivationEvent = "onError"
	EventOnDone    ActivationEvent = "onDone"
)

func (d *Downloader) InstallExtensionByGit(url string) (*Extension, error) {
	return d.fetchExtensionByGit(url, d.InstallExtensionByFolder)
}

func (d *Downloader) InstallExtensionByFolder(path string, devMode bool) (*Extension, error) {
	ext, err := d.parseExtensionByPath(path)

View on GitHub (pinned to 7b7327ffb3)

Solutions

  1. Verify manifest.json exists at the exact folder root you pass/sub-path you reference (os.Stat it first)
  2. For subdirectory extensions, install with the full /tree/<branch>/<subdir> URL pointing at the folder containing manifest.json
  3. Check spelling/case of the filename on case-sensitive systems

Example fix

# before
gopeed install https://github.com/user/monorepo # no manifest at root
# after
gopeed install https://github.com/user/monorepo/tree/main/packages/my-extension
Defensive patterns

Strategy: validation

Validate before calling

// Go: verify layout before installing
if _, err := os.Stat(filepath.Join(folder, "manifest.json")); err != nil {
    return fmt.Errorf("folder %s has no manifest.json: fix the path or repo subdirectory", folder)
}
_, err := downloader.InstallExtensionByFolder(folder, false)

Try / catch

if err == ErrExtensionNoManifest { /* errors.Is on older Go */ }

Prevention

When it happens

Trigger: InstallExtensionByGit('https://github.com/user/repo') when the repo root has no manifest.json (it lives in a subfolder); an install URL with /tree/main/packages/ext where the manifest sits elsewhere; InstallExtensionByFolder('/wrong/dir') or on a folder where manifest.json is misnamed (Manifest.json, manifest.json.txt).

Common situations: Monorepos hosting the extension in a subdirectory; cloning a template repo and moving files; case-sensitive filesystems after copying from macOS/Windows; .gitignore accidentally excluding manifest.json.

Related errors


AI-assisted analysis of GopeedLab/gopeed@7b7327ffb3 (2026-08-16). Data as JSON: /api/errors/894a01ecee9aaa63. Report an issue: GitHub.