{"record":{"id":"9b82eaa107dde155","repo":"yiisoft/yii2","slug":"unable-to-write-output-javascript-file-outputfi","errorCode":null,"errorMessage":"Unable to write output JavaScript file '{$outputFile}'.","messagePattern":"Unable to write output JavaScript file '(.+?)'\\.","errorType":"console","errorClass":"yii\\console\\Exception","httpStatus":null,"severity":"error","filePath":"framework/console/controllers/AssetController.php","lineNumber":588,"sourceCode":"     * @param string $outputFile output file name.\n     * @throws \\yii\\console\\Exception on failure.\n     */\n    public function combineJsFiles($inputFiles, $outputFile)\n    {\n        $content = '';\n        foreach ($inputFiles as $file) {\n            // Add a semicolon to source code if trailing semicolon missing.\n            // Notice: It needs a new line before `;` to avoid affection of line comment. (// ...;)\n            $fileContent = rtrim(file_get_contents($file));\n            if (substr($fileContent, -1) !== ';') {\n                $fileContent .= \"\\n;\";\n            }\n            $content .= \"/*** BEGIN FILE: $file ***/\\n\"\n                . $fileContent . \"\\n\"\n                . \"/*** END FILE: $file ***/\\n\";\n        }\n        if (!file_put_contents($outputFile, $content)) {\n            throw new Exception(\"Unable to write output JavaScript file '{$outputFile}'.\");\n        }\n    }\n\n    /**\n     * Combines CSS files into a single one.\n     * @param array $inputFiles source file names.\n     * @param string $outputFile output file name.\n     * @throws \\yii\\console\\Exception on failure.\n     */\n    public function combineCssFiles($inputFiles, $outputFile)\n    {\n        $content = '';\n        $outputFilePath = dirname($this->findRealPath($outputFile));\n        foreach ($inputFiles as $file) {\n            $content .= \"/*** BEGIN FILE: $file ***/\\n\"\n                . $this->adjustCssUrl(file_get_contents($file), dirname($this->findRealPath($file)), $outputFilePath)\n                . \"/*** END FILE: $file ***/\\n\";\n        }","sourceCodeStart":570,"sourceCodeEnd":606,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/console/controllers/AssetController.php#L570-L606","documentation":"Error \"Unable to write output JavaScript file '{$outputFile}'.\" thrown in yiisoft/yii2.","triggerScenarios":"Thrown at framework/console/controllers/AssetController.php:588 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"66f00d18a29b520f85e8e8f1e32d1e7e7b556cac","analyzedAt":"2026-08-17T05:17:23.470Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}