Skip to content
This repository was archived by the owner on Sep 9, 2021. It is now read-only.
This repository was archived by the owner on Sep 9, 2021. It is now read-only.

Inline workers does not work in Edge Legacy anymore #292

@mpk

Description

@mpk
  • Operating System: Windows 10
  • Node Version: 12.14.0
  • NPM Version: 6.13.4
  • webpack Version: 4.44.2
  • worker-loader Version: 3.0.3

Expected Behavior

Inline worker should execute in Edge Legacy

Actual Behavior

Inline worker does not execute in Edge Legacy

Code

// webpack.config.js
let HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
	entry: './index.js',
	plugins: [new HtmlWebpackPlugin()]
};
// index.js
import TestWorker from 'worker-loader?inline=no-fallback!./worker';

let worker = new TestWorker();
console.log(worker);
// worker.js
console.log('Log from worker');

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 in inline.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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions