nodejs/node · error

couldn't make the res fileName for bundle %s. Error:%s

Error message

couldn't make the res fileName for  bundle %s. Error:%s

What it means

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.

Source

Thrown at deps/icu-small/source/tools/genrb/genrb.cpp:747

                    filename, u_errorName(status));
            return;
        }
        /* count the number of just-added key strings */
        for(const char *newKeysLimit = newKeys + newKeysLength; newKeys < newKeysLimit; ++newKeys) {
            if(*newKeys == 0) {
                ++newPoolBundle->fKeysCount;
            }
        }
    }

    if(options[USE_POOL_BUNDLE].doesOccur) {
        data->fUsePoolBundle = &poolBundle;
    }

    /* Determine the target rb filename */
    uprv_free(make_res_filename(filename, outputDir, packageName, status));
    if(U_FAILURE(status)) {
        fprintf(stderr, "couldn't make the res fileName for  bundle %s. Error:%s\n",
                filename, u_errorName(status));
        return;
    }
    if(write_java== true){
        bundle_write_java(data.getAlias(), outputDir, outputEnc,
                          outputFileName, sizeof(outputFileName),
                          options[JAVA_PACKAGE].value, options[BUNDLE_NAME].value, &status);
    }else if(write_xliff ==true){
        bundle_write_xml(data.getAlias(), outputDir, outputEnc,
                         filename, outputFileName, sizeof(outputFileName),
                         language, xliffOutputFileName, &status);
    }else{
        /* Write the data to the file */
        data->write(outputDir, packageName, outputFileName, sizeof(outputFileName), status);
    }
    if (U_FAILURE(status)) {
        fprintf(stderr, "couldn't write bundle %s. Error:%s\n", outputFileName, u_errorName(status));
    }

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Verify the -d output directory exists and is writable: `ls -la <outputDir>`
  2. Ensure the input filename has a proper base name (not just '.txt') and uses correct path separators for the platform
  3. Check the -p package name for path-incompatible characters (slashes, colons, spaces)
  4. Run genrb with an absolute path for both input and output to eliminate relative path ambiguity
  5. Check the u_errorName in the message for the specific failure code
Defensive patterns

Strategy: validation

Validate before calling

# Validate genrb inputs before running
# Check output directory exists and is writable
[ -d "$OUTPUT_DIR" ] && [ -w "$OUTPUT_DIR" ] || echo "ERROR: output dir missing or unwritable"
# Check input filename has a base name
filename=$(basename "$INPUT_FILE")
base="${filename%%.*}"
[ -n "$base" ] || echo "ERROR: filename has no base name"
# Check package name for path-incompatible characters
echo "$PACKAGE_NAME" | grep -qP '[/\\:]' && echo "ERROR: package name contains path characters"

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13). Data as JSON: /api/errors/0ba3361a628172d7. Report an issue: GitHub.