Closed Bug 1956163 Opened 28 days ago Closed 26 days ago

The error message for a missing JavaScript module (ModuleSourceLoadFailed) should indicate the parent module that requested the missing module

Categories

(Core :: JavaScript Engine, enhancement, P1)

Firefox 136
enhancement

Tracking

()

RESOLVED FIXED
138 Branch
Tracking Status
firefox138 --- fixed

People

(Reporter: cob.bzmoz, Assigned: cob.bzmoz)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0

Steps to reproduce:

Load a page that contains some module script A, which attempts to import a non-existent module script B.

Actual results:

Firefox displayed an error message for the failure to load B, but this error message gave incorrect information on what file attempted to load B (it displayed the filename of the current document).

Expected results:

Firefox should have displayed the name of A, as Chrome does, to help me figure out which JavaScript file contained an incorrect import.

Attached file testcase.zip

This testcase consists of an HTML file, testcase.html, which loads a top-level module, parent-module.js; that module in turn attempts to load the (intentionally absent) nonexistent.js module.

When run in Firefox, the error location (righthand side) will be listed as testcase.html. When run in Chrome (on a local server), you should see a net::ERR_ABORTED 404 error with the source location given as parent-module.js.

When a child module fails to load, the parent module that requested it is now used as the source location for the error message.

Assignee: nobody → cob.bzmoz
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Severity: -- → N/A
Priority: -- → P1
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/5e415c25428a ScriptLoader now reports child module load failures as coming from the parent module. r=arai
Status: ASSIGNED → RESOLVED
Closed: 26 days ago
Resolution: --- → FIXED
Target Milestone: --- → 138 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: