regenerator icon indicating copy to clipboard operation
regenerator copied to clipboard

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

Open tdriley opened this issue 2 years ago • 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: https://github.com/formium/tsdx/issues/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

tdriley avatar Jul 19 '21 20:07 tdriley

Duplicate of https://github.com/facebook/regenerator/issues/450

JLHwung avatar Jul 19 '21 22:07 JLHwung

I managed to remove the problem code by upgrading or removing some packages which use regenerator-runtime, detailed here: https://github.com/babel/babel/issues/13574#issuecomment-886902873

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

tdriley avatar Jul 26 '21 22:07 tdriley