Updating a Firefox addon

Hi Leo, I’m a newbie. I don’t know how to direct my question to the right person.
When I upload an addon update to Firefox - as I have done before - all my files with module “imports” are rejected.

They test out OKAY in Firefox 61 (I’m not using developer or nightly). Do you know why the javascript modules might be rejected? Is it because I’m not using the .mjs extension in the filename? (I’m using .js)

Thanx, in advance, for your help. ~John

Hi John, the #add-ons:development category should be able to help with your question.

I’ve moved it there :slight_smile:

1 Like

What exactly do you mean by “javascript modules” and "rejected? Where and how do you want to load them? Do you get error messages? Which?

Thanx, Leo. I’ll checkout your link. ~John

This refers to a Firefox “addon”. Javascript modules are a new ES6 construct. My addon is being rejected when I upload to: https://addons.mozilla.org/en-US/firefox/. Leo has directed me to:

Ah, so you get your error not from Firefox but AMO. (Which means this is probably not the best category.)
Anyway:

Do you get error messages? Which?

1 Like

Do you load the initial script as module? Or do you use the “normal” scripts key to load them in the manifest? In order for import statements to be allowed, you need to load you initial script as module. You can currently only do that with a <script type="module"> tag in HTML and not directly from the manifest. This also means that you can not load content scripts as modules.

P.S.: your post has been moved to the add-on development category already.

1 Like

Thanx for your reply and help. I would have to re-upload to generate the errors - however; I deleted the zip and have modified my files to have a .mjs extension on all my imported files and am now in limbo.
However; @freaktechnik has given me some additional info which I will pursue.
I am assuming that AMO will handle the .mjs, imports and exports once I have everything configured correctly. ONCE AGAIN, THANX FOR THE HELP!!

Thanx for your reply and help. I would have to re-upload to generate the errors - however; I deleted the zip and have modified my files to have a .mjs extension on all my imported files and am now in limbo.
However; you have given me some additional info which I will pursue.
I am assuming that AMO will handle the .mjs, imports and exports once I have everything configured correctly. ONCE AGAIN, THANX FOR THE HELP!!

See https://github.com/mozilla/addons-linter/issues/1775

1 Like