Worker with ES Modules throws JavaScript TypeError: Using ImportScripts
inside a Module Worker is disallowed. (Firefox, Safari, Chrome --disable-native-automation)
#8251
Labels
TYPE: bug
The described behavior is considered as wrong (bug).
What is your Scenario?
I want to test a page that uses WebWorkers with real ES modules.
What is the Current behavior?
The page throws with:
TypeError: WorkerGlobalScope.importScripts: Using ImportScripts inside a Module Worker is disallowed.
What is the Expected behavior?
The page should not throw.
What is the public URL of the test page? (attach your complete example)
https://github.com/htho/testcafe-repro-module-worker -- see this repository
What is your TestCafe test code?
Your complete configuration file
No response
Your complete test report
Screenshots
No response
Steps to Reproduce
TestCafe version
3.6.2
Node.js version
v20.15.1
Command-line arguments
testcafe firefox test.tc.ts
Browser name(s) and version(s)
Firefox 128.0.3
Platform(s) and version(s)
Windows 10
Other
Needles to say that the page/worker does not use
importScripts()
.But it seems that TestCafe/Hammerhead adds
importScripts()
to the workers source.This is also why it works with Chrome with native automation.
Chrome has been suppotring ES Modules in workers for a while now. Firefox just catched up.
There will soon be more people having this problem as soon as they create apps without an
importScripts()
fallback.The text was updated successfully, but these errors were encountered: