-
Notifications
You must be signed in to change notification settings - Fork 146
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
"Unexpected token =" Error in module #3778
Comments
The problem seems to be the public field declaration, which isn't supported yet: #3062 |
@willdurand You are right, thanks for the quick response. It's probably the wrong place to ask but, do you know if it is it possible to ignore the linter error on AMO and upload the add-on anyway? If not I probably just write the code in an older syntax of JavaScript. Issue can be closed as a duplicate I guess. |
It isn't possible to by pass the linter. We follow ESLint regarding feature support, and this specific feature should be supported soon. In the meantime, you have to either not use this feature or transpile your JS code. |
Duplicate of #3062 |
I tried uploading a new version of my addon on AMO and got the error mentioned in #3639. I was able to resolve these errors by changing the affected module file extensions from .js to .mjs. However another but similar error still appears:
JavaScript syntax error (Parsing as module error: Unexpected token = at line: 3 and column: 13) (Parsing as script error: Cannot use 'import.meta' outside a module at line: 1 and column: 20)
I've tried to minimize the file that causes the error:
If I remove the import.meta statement the error still occurs but slightly different.
JavaScript syntax error (Parsing as module error: Unexpected token = at line: 2 and column: 13) (Parsing as script error: 'import' and 'export' may appear only with 'sourceType: module' at line: 1 and column: 1)
The text was updated successfully, but these errors were encountered: