{"record":{"id":"58944ef7aa2ff8a2","repo":"nodejs/node","slug":"s-icu4xmode-requires-ucadata-n","errorCode":null,"errorMessage":"%s: --icu4xMode requires --ucadata\\n","messagePattern":"(.+?): --icu4xMode requires --ucadata\\\\n","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/genrb/genrb.cpp","lineNumber":161,"sourceCode":"    U_MAIN_INIT_ARGS(argc, argv);\n\n    options[JAVA_PACKAGE].value = \"com.ibm.icu.impl.data\";\n    options[BUNDLE_NAME].value = \"LocaleElements\";\n    argc = u_parseArgs(argc, argv, UPRV_LENGTHOF(options), options);\n\n    /* error handling, printing usage message */\n    if(argc<0) {\n        fprintf(stderr, \"%s: error in command line argument \\\"%s\\\"\\n\", argv[0], argv[-argc]);\n        illegalArg = true;\n    } else if(argc<2) {\n        illegalArg = true;\n    }\n    if(options[WRITE_POOL_BUNDLE].doesOccur && options[USE_POOL_BUNDLE].doesOccur) {\n        fprintf(stderr, \"%s: cannot combine --writePoolBundle and --usePoolBundle\\n\", argv[0]);\n        illegalArg = true;\n    }\n    if (options[ICU4X_MODE].doesOccur && !options[UCADATA].doesOccur) {\n        fprintf(stderr, \"%s: --icu4xMode requires --ucadata\\n\", argv[0]);\n        illegalArg = true;\n    }\n    if(options[FORMAT_VERSION].doesOccur) {\n        const char *s = options[FORMAT_VERSION].value;\n        if(uprv_strlen(s) != 1 || (s[0] < '1' || '3' < s[0])) {\n            fprintf(stderr, \"%s: unsupported --formatVersion %s\\n\", argv[0], s);\n            illegalArg = true;\n        } else if(s[0] == '1' &&\n                  (options[WRITE_POOL_BUNDLE].doesOccur || options[USE_POOL_BUNDLE].doesOccur)\n        ) {\n            fprintf(stderr, \"%s: cannot combine --formatVersion 1 with --writePoolBundle or --usePoolBundle\\n\", argv[0]);\n            illegalArg = true;\n        } else {\n            setFormatVersion(s[0] - '0');\n        }\n    }\n\n    if((options[JAVA_PACKAGE].doesOccur || options[BUNDLE_NAME].doesOccur) &&","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/genrb/genrb.cpp#L143-L179","documentation":"genrb's --icu4xMode produces output tailored for ICU4X consumption and depends on a precompiled uca data file (--ucadata). Using --icu4xMode without --ucadata is unsupported, so genrb records the violation via illegalArg and exits non-zero after printing usage.","triggerScenarios":"options[ICU4X_MODE].doesOccur is true while options[UCADATA].doesOccur is false on the same genrb command.","commonSituations":"Adopting ICU4X-compatible data generation but forgetting the uca data input; copying a partial flag set from migration docs; a build target that toggles --icu4xMode via a variable without also setting --ucadata.","solutions":["Always pass --ucadata <file> alongside --icu4xMode, pointing at the compiled collation/uca data file.","If you did not intend ICU4X output, remove --icu4xMode.","Wire your build so that enabling ICU4X mode also supplies the ucadata path (e.g. a single make variable that sets both)."],"exampleFix":"# before\ngenrb --icu4xMode en.txt\n\n# after\ngenrb --icu4xMode --ucadata uca.icu en.txt","handlingStrategy":"validation","validationCode":"// require --ucadata whenever --icu4xMode is set\nif '--icu4xMode' in argv and '--ucadata' not in argv:\n    raise SystemExit('genrb: --icu4xMode requires --ucadata <file>')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bind both flags to one build variable so enabling ICU4X mode always supplies the uca data.","Document the ucadata input path in the build config alongside the ICU4X switch."],"tags":["icu","genrb","cli","icu4x","dependency"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}