Open Bug 1872483 Opened 5 months ago Updated 12 days ago

Web Worker ES Module Import Error is not displayed

Categories

(Core :: DOM: Workers, defect, P3)

Firefox 121
defect

Tracking

()

People

(Reporter: brandmairstefan, Unassigned)

References

(Depends on 1 open bug)

Details

Attachments

(1 file)

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

Steps to reproduce:

I created a web worker, and used an import statement inside the web worker script.

The import statement in the attached example is
import { fuu } from "./test.js";
which misspells the "foo" function from test.js.

Actual results:

Since the import statement was incorrect, the worker immediately terminated. The dev tools console did not show any error message.

Expected results:

The worker should have immediately terminated, and the dev tools console should show an error message.

Component: Untriaged → DOM: Workers
Product: Firefox → Core

Online reproduction demo https://stefnotch.github.io/web-worker-es-module-import-issue/
Chrome has the issue, so I opened a report over there as well https://bugs.chromium.org/p/chromium/issues/detail?id=1514833

@asuth could you please take a look at it ?

Flags: needinfo?(bugmail)

The Chrome bug seems to be an older bug already. The bug I opened over there was closed as a duplicate of https://issues.chromium.org/issues/40184459

And adding a bit of extra info for anyone who stumbles upon this:
This error can be caught with an onerror event listener. However, the error will not contain any useful information whatsoever.

I can confirm comment 0 and comment 3; we fire an error event on the worker that is useless. This is likely related to bug 1271441. There also was some older spec discussion at least as it relates to SharedWorker error reporting which may have some relevant incidental discussion since it's largely the same spec text.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Depends on: 1271441
Ever confirmed: true
Flags: needinfo?(bugmail)
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: