{"id":"d13d7318af86d3ba","repo":"webpack/webpack","slug":"compiler-getinfrastructurelogger-name-called-with-d13d73","errorCode":null,"errorMessage":"Compiler.getInfrastructureLogger(name) called with a function not returning a name","messagePattern":"Compiler\\.getInfrastructureLogger\\(name\\) called with a function not returning a name","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"lib/Compiler.js","lineNumber":417,"sourceCode":"\t}\n\n\t/**\n\t * Gets infrastructure logger.\n\t * @param {string | (() => string)} name name of the logger, or function called once to get the logger name\n\t * @returns {Logger} a logger with that name\n\t */\n\tgetInfrastructureLogger(name) {\n\t\tif (!name) {\n\t\t\tthrow new TypeError(\n\t\t\t\t\"Compiler.getInfrastructureLogger(name) called without a name\"\n\t\t\t);\n\t\t}\n\t\treturn new Logger(\n\t\t\t(type, args) => {\n\t\t\t\tif (typeof name === \"function\") {\n\t\t\t\t\tname = name();\n\t\t\t\t\tif (!name) {\n\t\t\t\t\t\tthrow new TypeError(\n\t\t\t\t\t\t\t\"Compiler.getInfrastructureLogger(name) called with a function not returning a name\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\tthis.hooks.infrastructureLog.call(name, type, args) === undefined &&\n\t\t\t\t\tthis.infrastructureLogger !== undefined\n\t\t\t\t) {\n\t\t\t\t\tthis.infrastructureLogger(name, type, args);\n\t\t\t\t}\n\t\t\t},\n\t\t\t(childName) => {\n\t\t\t\tif (typeof name === \"function\") {\n\t\t\t\t\tif (typeof childName === \"function\") {\n\t\t\t\t\t\treturn this.getInfrastructureLogger(() => {\n\t\t\t\t\t\t\tif (typeof name === \"function\") {\n\t\t\t\t\t\t\t\tname = name();\n\t\t\t\t\t\t\t\tif (!name) {","sourceCodeStart":399,"sourceCodeEnd":435,"githubUrl":"https://github.com/webpack/webpack/blob/318421ea8ac81371f5171236a6efb63675576528/lib/Compiler.js#L399-L435","documentation":"Error \"Compiler.getInfrastructureLogger(name) called with a function not returning a name\" thrown in webpack/webpack.","triggerScenarios":"Thrown at lib/Compiler.js:417 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the function passed to compiler.getInfrastructureLogger returns a non-empty string name, or pass the name string directly."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"318421ea8ac81371f5171236a6efb63675576528","analyzedAt":"2026-08-03T19:39:56.731Z","schemaVersion":2}