molnarg / node-http2

An HTTP/2 client and server implementation for node.js
MIT License
1.79k stars 187 forks source link

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted #257

Open mesqueeb opened 3 years ago

mesqueeb commented 3 years ago

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

pointing to this line: modules.map(require).forEach(function(module) {

exports.VERSION = 'h2';

exports.Endpoint = require('./endpoint').Endpoint;

/* Bunyan serializers exported by submodules that are worth adding when creating a logger. */
exports.serializers = {};
var modules = ['./framer', './compressor', './flow', './connection', './stream', './endpoint'];
modules.map(require).forEach(function(module) {
  for (var name in module.serializers) {
    exports.serializers[name] = module.serializers[name];
  }
});