cloudinary / cloudinary_npm

Cloudinary NPM for node.js integration
629 stars 323 forks source link

Critical dependency: the request of a dependency is an expression #571

Closed JacobSiegle closed 1 year ago

JacobSiegle commented 1 year ago

Describe the bug in a sentence or two.

Importing cloudinary causes webpack build warnings.

Versions and Libraries (fill in the version numbers)

Cloudinary_NPM SDK version - 1.32.0 Node - 16

WARNING in ./node_modules/cloudinary/lib-es5/utils/index.js 1653:13-32
Critical dependency: the request of a dependency is an expression

WARNING in ./node_modules/cloudinary/lib/utils/index.js 1519:13-32
Critical dependency: the request of a dependency is an expression

Both of these lines point to -

function optionalRequire(moduleName) {
  var module = void 0;
  try {
    module = require(moduleName);
    return module;
  } catch (e) {
    if (e.code === "MODULE_NOT_FOUND") {
      return null;
    }
    throw e;
  }
}
tamaracloudinary commented 1 year ago

Hi @JacobSiegle, can I please ask you to provide more details about the problem you're encountering? Can you please share a sample of your code showing where the warnings show? Thanks -Tamara

JacobSiegle commented 1 year ago

@tamaracloudinary the compile error is miraculously gone today... maybe webpack was just on the fritz and restarting my computer resolved something over the weekend. No idea very bizarre, I'll re-open if I can figure out how to get it to popup again. Thanks anyway!