Open mpk opened 4 years ago
I'm using 5.
You need this loader only for inline? Because webpack 5 support worker out of box without this loader
Yes. This is the only loader can apply babel-loader for inline-worker as far as I know. By the way, I'm afraid bothering you because of this. If you are busy or it's annoying you, I'll handle this issue own myself.
Honestly because webpack v5 supports workers out of box I think we need new loader, which covert module code to blob, so you can built-in new Worker('./file.js', import.meta.url)
feature without this loader.
I think we need deprecate it in near future in favor new Worker('./file.js', import.meta.url)
, more abilities, more options, better support.
Expected Behavior
Inline worker should execute in Edge Legacy
Actual Behavior
Inline worker does not execute in Edge Legacy
Code
How Do We Reproduce?
The code should write "Log from worker" into the console. However, it does not work in Edge Legacy browser (tested on version 18.18363). The worker is created successfully, but its contents are not executed, so nothing gets logged into the console.
I have looked at the worker-loader code and found out that the problem is in
URL.revokeObjectURL(objectURL);
line ininline.js
. When I commented out that line, Edge executed the worker contents. Wrapping the call in setTimeout with 1000ms delay worked as well, but that solution seems quite hacky.This issue is not present in worker-loader 2.0.0