Closed Bug 1642144 Opened 4 years ago Closed 4 years ago

Better error message when type="module" is omitted

Categories

(Firefox :: Untriaged, enhancement)

76 Branch
enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1488262

People

(Reporter: edwin, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:76.0) Gecko/20100101 Firefox/76.0

Steps to reproduce:

Load a JavaScript module without specifying type="module". The error message is not helping developers to find the most likely solution.

Actual results:

This error appears in the console:

SyntaxError: import declarations may only appear at top level of a module

Expected results:

Give a more indicative error message, like:

SyntaxError: import declarations may only appear at top level of a module (did you load a JavaScript module without specifying type="module"?)

This bug seems to be a duplicate one of Bug 1488262.
Please reopen this bug if you think this bug isn't duplicate of Bug 1488262.
Thanks.

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.