nodejs/node · error

U_ILLEGAL_ARGUMENT_ERROR

U_ILLEGAL_ARGUMENT_ERROR

Error message

icupkg: --auto_toc_prefix_with_type and also --toc_prefix

What it means

`--auto_toc_prefix_with_type` derives the TOC prefix automatically from each item's type; supplying `--toc_prefix` at the same time is contradictory. icupkg detects both flags set, prints the conflict, shows usage, and returns U_ILLEGAL_ARGUMENT_ERROR.

Source

Thrown at deps/icu-small/source/tools/icupkg/icupkg.cpp:299

        printUsage(pname, true);
        return U_ZERO_ERROR;
    }

    pkg=new Package;
    if(pkg==nullptr) {
        fprintf(stderr, "icupkg: not enough memory\n");
        return U_MEMORY_ALLOCATION_ERROR;
    }
    isModified=false;

    int autoPrefix=0;
    if(options[OPT_AUTO_TOC_PREFIX].doesOccur) {
        pkg->setAutoPrefix();
        ++autoPrefix;
    }
    if(options[OPT_AUTO_TOC_PREFIX_WITH_TYPE].doesOccur) {
        if(options[OPT_TOC_PREFIX].doesOccur) {
            fprintf(stderr, "icupkg: --auto_toc_prefix_with_type and also --toc_prefix\n");
            printUsage(pname, false);
            return U_ILLEGAL_ARGUMENT_ERROR;
        }
        pkg->setAutoPrefixWithType();
        ++autoPrefix;
    }
    if(argc<2 || 3<argc || autoPrefix>1) {
        printUsage(pname, false);
        return U_ILLEGAL_ARGUMENT_ERROR;
    }

    if(options[OPT_SOURCEDIR].doesOccur) {
        sourcePath=options[OPT_SOURCEDIR].value;
    } else {
        // work relative to the current working directory
        sourcePath=nullptr;
    }
    if(options[OPT_DESTDIR].doesOccur) {

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Use exactly one of `--auto_toc_prefix_with_type` or `--toc_prefix`.
  2. Let auto-prefixing derive the value, or supply it explicitly — not both.

Example fix

# before
icupkg --auto_toc_prefix_with_type --toc_prefix my in.dat
# after
icupkg --toc_prefix my in.dat
Defensive patterns

Strategy: validation

Validate before calling

# bash: the two flags are mutually exclusive
if [ -n "$TOC_PREFIX" ] && [ "$AUTO_TOC_WITH_TYPE" = 1 ]; then
  echo "--toc_prefix and --auto_toc_prefix_with_type are mutually exclusive" >&2; exit 2
fi

Prevention

When it happens

Trigger: Passing both `--auto_toc_prefix_with_type` and `--toc_prefix <prefix>` in one invocation.

Common situations: Build scripts that prepend a default flag block then append an explicit prefix; copy-pasted commands from different recipes.

Related errors


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