{"record":{"id":"0ba3361a628172d7","repo":"nodejs/node","slug":"couldn-t-make-the-res-filename-for-bundle-s-err","errorCode":null,"errorMessage":"couldn't make the res fileName for  bundle %s. Error:%s","messagePattern":"couldn't make the res fileName for  bundle (.+?)\\. Error:(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/genrb/genrb.cpp","lineNumber":747,"sourceCode":"                    filename, u_errorName(status));\n            return;\n        }\n        /* count the number of just-added key strings */\n        for(const char *newKeysLimit = newKeys + newKeysLength; newKeys < newKeysLimit; ++newKeys) {\n            if(*newKeys == 0) {\n                ++newPoolBundle->fKeysCount;\n            }\n        }\n    }\n\n    if(options[USE_POOL_BUNDLE].doesOccur) {\n        data->fUsePoolBundle = &poolBundle;\n    }\n\n    /* Determine the target rb filename */\n    uprv_free(make_res_filename(filename, outputDir, packageName, status));\n    if(U_FAILURE(status)) {\n        fprintf(stderr, \"couldn't make the res fileName for  bundle %s. Error:%s\\n\",\n                filename, u_errorName(status));\n        return;\n    }\n    if(write_java== true){\n        bundle_write_java(data.getAlias(), outputDir, outputEnc,\n                          outputFileName, sizeof(outputFileName),\n                          options[JAVA_PACKAGE].value, options[BUNDLE_NAME].value, &status);\n    }else if(write_xliff ==true){\n        bundle_write_xml(data.getAlias(), outputDir, outputEnc,\n                         filename, outputFileName, sizeof(outputFileName),\n                         language, xliffOutputFileName, &status);\n    }else{\n        /* Write the data to the file */\n        data->write(outputDir, packageName, outputFileName, sizeof(outputFileName), status);\n    }\n    if (U_FAILURE(status)) {\n        fprintf(stderr, \"couldn't write bundle %s. Error:%s\\n\", outputFileName, u_errorName(status));\n    }","sourceCodeStart":729,"sourceCodeEnd":765,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/genrb/genrb.cpp#L729-L765","documentation":"genrb calls make_res_filename() to construct the output .res file path from the input filename, output directory, and package name. If this path construction fails (returns a non-zero UErrorCode), genrb cannot determine where to write the compiled resource bundle. The function handles path separators, package name embedding, and suffix replacement.","triggerScenarios":"Passing an outputDir that is null or contains invalid characters; a filename with no base name (e.g. '.txt'); a packageName that causes path overflow; or output directory path construction that exceeds internal buffer limits. The make_res_filename function performs string operations that can fail on malformed input.","commonSituations":"Misconfigured -d (output directory) option pointing to a path with special characters; running genrb on a file whose name is only an extension; incorrect -p (package name) with path-incompatible characters; Windows path separator issues on cross-platform builds.","solutions":["Verify the -d output directory exists and is writable: `ls -la <outputDir>`","Ensure the input filename has a proper base name (not just '.txt') and uses correct path separators for the platform","Check the -p package name for path-incompatible characters (slashes, colons, spaces)","Run genrb with an absolute path for both input and output to eliminate relative path ambiguity","Check the u_errorName in the message for the specific failure code"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Validate genrb inputs before running\n# Check output directory exists and is writable\n[ -d \"$OUTPUT_DIR\" ] && [ -w \"$OUTPUT_DIR\" ] || echo \"ERROR: output dir missing or unwritable\"\n# Check input filename has a base name\nfilename=$(basename \"$INPUT_FILE\")\nbase=\"${filename%%.*}\"\n[ -n \"$base\" ] || echo \"ERROR: filename has no base name\"\n# Check package name for path-incompatible characters\necho \"$PACKAGE_NAME\" | grep -qP '[/\\\\:]' && echo \"ERROR: package name contains path characters\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always use absolute paths for -d (output directory) to avoid relative path ambiguity","Ensure input filenames have a proper base name component before the extension","Avoid special characters in the -p (package name) option","Verify the output directory exists before running genrb"],"tags":["icu","genrb","filename","path-construction","output"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}