monaco-tm icon indicating copy to clipboard operation
monaco-tm copied to clipboard

Critical dependency: the request of a dependency is an expression

Open ZsgsDesign opened this issue 3 years ago • 0 comments

When using webpack for this project, I got the following warning:

WARNING in ./node_modules/vscode-textmate/release/main.js 23:15-27
Critical dependency: the request of a dependency is an expression
 @ ./src/providers.ts
 @ ./src/app.ts
 @ multi ./src/app.ts

Looks like some dynamically linked modules can not be statically determined by webpack. I checked the vscode-textmate code:

function $load(name, factory) {
    var mod = {
        exports: {}
    };
    var requireFunc = function (mod) {
        if ($map[mod]) {
            return $map[mod].exports;
        }
        return require(mod);
    };
    factory.call(this, requireFunc, mod, mod.exports);
    $map[name] = mod;
}

Looks like the require(mod) caused the problem.

Is it safe to just dismiss the warning or is there anything we need to do about it?

ZsgsDesign avatar Aug 21 '21 17:08 ZsgsDesign