Skip to content

UsageError message could be more helpful: "Cannot use... auto-generated extension ID" #3309

@mcomella

Description

@mcomella

Is this a feature request or a bug?

Bug?

What is the current behavior?

I'm not sure what the exact extension state is that triggers this. I haven't used this tool in a long time and when I updated it and ran web-ext sign, I received the following error message:

UsageError: Cannot use previously auto-generated extension ID {redacted} - This extension ID must be specified in the manifest.json file.

What is the expected or desired behavior?

The supplied error message could be more helpful and tell you specifically which key to add, e.g.:

UsageError: Cannot use previously auto-generated extension ID {redacted} - This extension ID must be specified in the manifest.json file:

// manifest.json
{
    "browser_specific_settings": {
        "gecko": {
            "id": "{redacted}"
        }
    },

    ...
}

As a user, I spent about twenty minutes looking for a solution. I started in the the manifest.json docs (which doesn't have the answer) and eventually found a hint to the answer by searching in the web-ext source code.

The code that triggers this error message is here:

web-ext/src/cmd/sign.js

Lines 67 to 70 in cde10a8

throw new UsageError(
'Cannot use previously auto-generated extension ID ' +
`${idFromSourceDir} - This extension ID must be specified in the manifest.json file.`,
);

Version information (for bug reports)

  • Firefox version: 131.0b5
  • Your OS and version: macOS 14.6.1
  • Paste the output of these commands:
$ node --version && npm --version && npx web-ext --version
v22.9.0
10.8.3
8.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions