GopeedLab/gopeed · error

extension name is required

Error message

extension name is required

What it means

Extension.validate() requires a non-empty name in manifest.json; parseExtensionByPath runs it right after unmarshalling. The name is the machine identifier (combined with author in buildIdentity as author@name), so an empty name would break storage keys, the extensions directory path, and lookup by identity.

Source

Thrown at pkg/download/extension.go:438

	Homepage string `json:"homepage"`
	// Repository git repository info
	Repository *Repository `json:"repository"`
	Scripts    []*Script   `json:"scripts"`
	Settings   []*Setting  `json:"settings"`
	// Disabled if true, this extension will be ignored
	Disabled bool `json:"disabled"`

	DevMode bool `json:"devMode"`
	// DevPath is the local path of extension source code
	DevPath string `json:"devPath"`

	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

func (e *Extension) validate() error {
	if e.Name == "" {
		return fmt.Errorf("extension name is required")
	}
	if e.Title == "" {
		return fmt.Errorf("extension title is required")
	}
	if e.Version == "" {
		return fmt.Errorf("extension version is required")
	}
	return nil
}

func (e *Extension) buildIdentity() string {
	if e.Author == "" {
		return e.Name
	}
	return e.Author + "@" + e.Name
}

func (e *Extension) buildInstallUrl() string {

View on GitHub (pinned to 7b7327ffb3)

Solutions

  1. Add a non-empty, unique "name" (lowercase slug recommended) to manifest.json
  2. Confirm the key is exactly "name" and at the top level
  3. Validate the manifest with a JSON linter to catch structural mistakes

Example fix

// before (manifest.json)
{ "title": "My Ext", "version": "1.0.0" }
// after
{ "name": "my-extension", "title": "My Ext", "version": "1.0.0" }
Defensive patterns

Strategy: validation

Validate before calling

// Go: pre-validate manifest before install
var m struct {
    Name    string `json:"name"`
    Title   string `json:"title"`
    Version string `json:"version"`
}
if err := json.Unmarshal(raw, &m); err != nil { return err }
if strings.TrimSpace(m.Name) == "" { return fmt.Errorf("manifest.json: 'name' is required") }

Prevention

When it happens

Trigger: manifest.json without a "name" key, or "name": "" / whitespace-only; a manifest where name is nested under another object or misspelled ("Name", "id") so json.Unmarshal leaves the field zero.

Common situations: Hand-written manifests from a template with placeholders never filled; renaming keys when porting a browser-extension manifest.json (which uses different casing); JSON comments or trailing commas causing partial unmarshal issues.

Related errors


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