You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, Im trying to use threads (1.7.0) in a legacy device - Safari 7
The code works on modern GoogleChrome, but when trying to run it on Safari 7, it throws when importing the library.
The following code prints only Before load threads and then throws Super expression must either be null or a function
try {
console.error('Before load threads');
const { Worker } = await import('threads');
console.error('after load threads'); // never prints
} catch (error) {
console.error('Error loading threads', error); // throws ...."Super expression must either be null or a function"
}
Any idea what can it be or how to fix it?
PS: The issue is not the async import, for sure: the file where this code is written, is itself imported async. And just to be sure I tried also with regular import (at the head of the file), and got the same error.
Update 1: The same happens with Safari 7, 8 and 9. It works on Safari 10
Update 2: The cause for the exception is in the file master/implementation.browser.js, it is checking if (typeof Worker === "undefined".
For Safari 3 and below, typeof Worker === "undefined". For Safari 10 and up, typeof Worker === "function". But for Safari 7-9, typeof Worker === "object". So when it tries to extend from Worker on line 24 class WebWorker extends Worker it fails because is an object, not a function and throws the Super expression ... exception
The text was updated successfully, but these errors were encountered:
Hey, Im trying to use threads (1.7.0) in a legacy device - Safari 7
The code works on modern GoogleChrome, but when trying to run it on Safari 7, it throws when importing the library.
The following code prints only
Before load threads
and then throwsSuper expression must either be null or a function
Any idea what can it be or how to fix it?
PS: The issue is not the async import, for sure: the file where this code is written, is itself imported async. And just to be sure I tried also with regular import (at the head of the file), and got the same error.
Update 1: The same happens with Safari 7, 8 and 9. It works on Safari 10
Update 2: The cause for the exception is in the file
master/implementation.browser.js
, it is checkingif (typeof Worker === "undefined"
.For Safari 3 and below,
typeof Worker === "undefined". For Safari 10 and up,
typeof Worker === "function". But for Safari 7-9,
typeof Worker === "object". So when it tries to extend from Worker on line 24class WebWorker extends Worker
it fails because is an object, not a function and throws theSuper expression ...
exceptionThe text was updated successfully, but these errors were encountered: