Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting lint errors with manifest_version set to 3 #2484

Closed
akash07k opened this issue Aug 16, 2022 · 10 comments · Fixed by #2505
Closed

Getting lint errors with manifest_version set to 3 #2484

akash07k opened this issue Aug 16, 2022 · 10 comments · Fixed by #2505

Comments

@akash07k
Copy link

akash07k commented Aug 16, 2022

Is this a feature request or a bug?

Bug

What is the current behavior?

Getting error while linting if the manifest_version is set to 3:
"manifest_version": 3,
Error:

Code           Message       Description            File   Line   Column
JSON_INVALID   "/manifest…   Your JSON file could                       
               _version"     not be parsed.                             
               must be <=                                               
               2                                                        

What is the expected or desired behavior?

Lint command should not throw error
log.txt

Version information (for bug reports)

  • Firefox version:
  • Your OS and version:
  • Paste the output of these commands:
    Node V18.7.0
    NPM V 8.15.0
    web-ext V7.2.0
node --version && npm --version && web-ext --version
@Rob--W
Copy link
Member

Rob--W commented Aug 16, 2022

Duplicate of #2379.

In short, use the --firefox-preview flag, which is also documented at https://extensionworkshop.com/documentation/develop/manifest-v3-migration-guide/#turn-on-the-developer-preview

@Rob--W Rob--W closed this as completed Aug 16, 2022
@Rob--W Rob--W reopened this Aug 16, 2022
@Rob--W
Copy link
Member

Rob--W commented Aug 16, 2022

Actually, the other one is about running, while this one is about the linter.

@akash07k
Copy link
Author

@Rob--W Can we reopen this please?
I'm not using firefox, I'm using chromium.

@Rob--W
Copy link
Member

Rob--W commented Aug 16, 2022

I have already re-opened this issue :)

@akash07k
Copy link
Author

not only linting, I'm unable to run my extension with firefox.
it says:
"invalid extension"
I've verified whole manifest, everything is fine.

@akash07k
Copy link
Author

test.log
I'm using Firefox developer edition with MV3 flags enabled

@Rob--W
Copy link
Member

Rob--W commented Aug 18, 2022

@akash07k What version of Firefox are you using?
Could you share your manifest.json file?

@jsom
Copy link

jsom commented Aug 20, 2022

Hit the linting issue as well - --firefox-preview only seems to be applicable to web-ext run so far, but it's making it difficult to maintain an extension across Firefox and Chrome.

$ node_modules/.bin/web-ext --version
7.2.0

$ node_modules/.bin/web-ext lint -s src
Applying config file: ./package.json
Validation Summary:

errors          2
notices         0
warnings        0

ERRORS:

Code                    Message                                    Description                                        File            Line   Column
JSON_INVALID            "/manifest_version" must be <= 2           Your JSON file could not be parsed.
EXTENSION_ID_REQUIRED   The extension ID is required in Manifest   See https://mzl.la/3PLZYdo for more information.   manifest.json
                        Version 3 and above.

$ node_modules/.bin/web-ext lint --firefox-preview -s src
web-ext lint

Validate the extension source
<snip options dump>
Unknown arguments: firefox-preview, firefoxPreview

@akash07k
Copy link
Author

akash07k commented Sep 9, 2022 via email

@akash07k
Copy link
Author

akash07k commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants