opentelemetry-js icon indicating copy to clipboard operation
opentelemetry-js copied to clipboard

use of eval is strongly discouraged

Open lnmp4000 opened this issue 1 year ago • 4 comments
trafficstars

Bundling with rollupjs generated the following error because of protobufjs usage.

(!) Use of eval is strongly discouraged
https://rollupjs.org/troubleshooting/#avoiding-eval
../node_modules/@protobufjs/inquire/index.js
10: function inquire(moduleName) {
11:     try {
12:         var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval
                      ^
13:         if (mod && (mod.length || Object.keys(mod).length))
14:             return mod;

This is included via the following tree:

  └─┬ @opentelemetry/[email protected]
    └─┬ @opentelemetry/[email protected]
      └── [email protected]

I don't understand why this is necessary, but it could potentially cause issues for code bundled via rollup.

https://rollupjs.org/troubleshooting/#avoiding-eval

Also see https://github.com/protobufjs/protobuf.js/issues/1754

lnmp4000 avatar Sep 10 '24 15:09 lnmp4000