facebook/regenerator

"The Function constructor is eval" warning from Mozilla Addons Linter

tdriley opened this issue · 2 comments

Our Browser Extension seems to be stuck in review with Mozilla, and their submission service is feeding back (what appear to be ESLint warnings), saying "The Function constructor is eval."

I can recreate the warnings by running the Mozilla addons-linter on our extension's dist files and have traced these warnings back to regenerator-runtime which is included as a dependency of babel, which we depend on heavily in our build setup with webpack.

I believe this may be related to this other regenerator issue which also seems to stem from the use of the Function constructor: jaredpalmer/tsdx#954

I've seen suggestions elsewhere that downgrading to regenerator-runtime v0.13.1 may fix the issue, but that version is no longer published on NPM, we'd need to do the downgrade in multiple places and we'll also be carrying forward instability in our build setup.

Envinfo:

System:
OS: macOS 10.15.7
Binaries:
Node: 12.2.0 - ~/.nvm/versions/node/v12.2.0/bin/node
npm: 7.5.2 - ~/.nvm/versions/node/v12.2.0/bin/npm
npmPackages:
@babel/core: ^7.5.5 => 7.5.5
@babel/preset-env: ^7.5.5 => 7.5.5
@babel/preset-react: ^7.0.0 => 7.0.0
babel-jest: ^24.9.0 => 24.9.0
babel-loader: ^8.0.6 => 8.0.6
babel-plugin-emotion: ^10.0.19 => 10.0.19
jest: ^24.9.0 => 24.9.0
webpack: ^4.39.2 => 4.39.2

Duplicate of #450

I managed to remove the problem code by upgrading or removing some packages which use regenerator-runtime, detailed here: babel/babel#13574 (comment)

It was not a problem with babel, as I originally thought.