Closed Bug 1517546 Opened 5 years ago Closed 5 years ago

Enable dynamic module import by default


(Core :: JavaScript Engine, defect, P2)




Tracking Status
firefox66 --- disabled
firefox67 + fixed


(Reporter: jonco, Assigned: jonco)


(Blocks 2 open bugs)


(Keywords: dev-doc-complete)


(1 file)

Dynamic module import as implemented in bug 1342012 is currently disabled by default behind the javascript.options.dynamicImport pref.
Component: DOM → JavaScript Engine
Depends on: 1342012
OS: Unspecified → All
Hardware: Unspecified → All
Priority: -- → P2
Depends on: 1522491

Tracking for 67 as it will probably deserve a mention in out developers release notes.

This has been enabled in nightly since the end of January and there haven't been any major bugs found. (Bug 1529203 was discovered but this was already present). What do you think about enabling this by default and letting it ride the trains, to ship in 67?

Please send email about this to dev.platform

Pushed by
Enable dyanmic module import by default r=smaug
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67

Hi, maybe I'm doing something wrong, but I'm not able to import a module in a webextension content script via the dynamic import. I also tried this version which works in chrome:

By trying it myself I got the following errors:
Error: TelemetryStopwatch: key "WEBEXT_CONTENT_SCRIPT_INJECTION_MS" was already initialized ExtensionTelemetry.jsm:106:31
Error: TelemetryStopwatch: key "WEBEXT_CONTENT_SCRIPT_INJECTION_MS_BY_ADDONID" was already initialized ExtensionTelemetry.jsm:110:41
Error: TelemetryStopwatch: requesting elapsed time for nonexisting stopwatch. Histogram: "WEBEXT_CONTENT_SCRIPT_INJECTION_MS", key: "" ExtensionTelemetry.jsm:106:31
Error: TelemetryStopwatch: requesting elapsed time for nonexisting stopwatch. Histogram: "WEBEXT_CONTENT_SCRIPT_INJECTION_MS_BY_ADDONID"

However the provided add-on above does not produce any errors, but still doesn't log anything to the console.

Firefox Developer Edition 66.0b14 (64-Bit), Linux with enabled javascript.options.dynamicImport pref;

(In reply to robbendebiene from comment #6)

I've filed bug 1536094 for this.

Note to MDN writers:

We've already added a note about this to the Fx67 rel notes:

It looks like the BCD for import() could do with being updated

I also think it'd make sense to include a tutorial somewhere (in the JS guide?) explaining JS module import/export, how to use them, etc.

I've also finished rabbit-holing on my guide to JS modules:

With that, I think the docs here and now complete. Feel free to give me a shout if you notice anything that isn't quite right.

You need to log in before you can comment on or make changes to this bug.