webworkify icon indicating copy to clipboard operation
webworkify copied to clipboard

Issue with webworkify and Webpack 5

Open amosbyon1224 opened this issue 5 years ago • 1 comments

Hello!

I'm running into some issues with using webworkify with a project I'm upgrading to Webpack 5.

I've created a minimum reproducible project here: https://github.com/amosbyon1224/webworkify-webpack5

I'm getting an error that arguments is undefined from here: https://github.com/browserify/webworkify/blob/master/index.js#L1

This was working fine as of webpack 4.27.1 but does not seem to work as of Webpack 5.6.0

amosbyon1224 avatar Nov 24 '20 21:11 amosbyon1224

Hello, I also met this problem and I fixed it by moved three vars into the module.exports like this:

  • before:
var bundleFn = arguments[3];
var sources = arguments[4];
var cache = arguments[5];
module.exports = function (fn, options) {
  ...
}
  • after:
module.exports = function (fn, options) {
  var bundleFn = arguments[3];
  var sources = arguments[4];
  var cache = arguments[5];
  ...
}

it works fine in my quasar V2 / vue3 project which use WebPack5 and roslib.js

legubiao avatar May 18 '21 11:05 legubiao