mozilla / web-ext

A command line tool to help build, run, and test web extensions
Mozilla Public License 2.0
2.72k stars 341 forks source link

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

Open mcomella opened 6 days ago

mcomella commented 6 days ago

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: https://github.com/mozilla/web-ext/blob/cde10a871e60f1fede2a79539563b13122f299bf/src/cmd/sign.js#L67-L70

Version information (for bug reports)

mcomella commented 6 days ago

I submitted a pull request: https://github.com/mozilla/web-ext/pull/3310