{"record":{"id":"b9a97905a95bfa30","repo":"nodejs/node","slug":"unknown-type-value-class-name-for-key","errorCode":null,"errorMessage":"Unknown type {value.__class__.__name__} for {key}","messagePattern":"Unknown type (.+?) for (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"tools/gyp/pylib/gyp/input.py","lineNumber":1398,"sourceCode":"    for key, value in the_dict.items():\n        # Skip \"variables\" and string values, which were already processed if\n        # present.\n        if key == \"variables\" or isinstance(value, str):\n            continue\n        if isinstance(value, dict):\n            # Pass a copy of the variables dict so that subdicts can't influence\n            # parents.\n            ProcessVariablesAndConditionsInDict(\n                value, phase, variables, build_file, key\n            )\n        elif isinstance(value, list):\n            # The list itself can't influence the variables dict, and\n            # ProcessVariablesAndConditionsInList will make copies of the variables\n            # dict if it needs to pass it to something that can influence it.  No\n            # copy is necessary here.\n            ProcessVariablesAndConditionsInList(value, phase, variables, build_file)\n        elif not isinstance(value, int):\n            raise TypeError(\"Unknown type \" + value.__class__.__name__ + \" for \" + key)\n\n\ndef ProcessVariablesAndConditionsInList(the_list, phase, variables, build_file):\n    # Iterate using an index so that new values can be assigned into the_list.\n    index = 0\n    while index < len(the_list):\n        item = the_list[index]\n        if isinstance(item, dict):\n            # Make a copy of the variables dict so that it won't influence anything\n            # outside of its own scope.\n            ProcessVariablesAndConditionsInDict(item, phase, variables, build_file)\n        elif isinstance(item, list):\n            ProcessVariablesAndConditionsInList(item, phase, variables, build_file)\n        elif isinstance(item, str):\n            expanded = ExpandVariables(item, phase, variables, build_file)\n            if type(expanded) in (str, int):\n                the_list[index] = expanded\n            elif isinstance(expanded, list):","sourceCodeStart":1380,"sourceCodeEnd":1416,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/tools/gyp/pylib/gyp/input.py#L1380-L1416","documentation":"When ProcessVariablesAndConditionsInDict recurses over the_dict's keys, it handles dict, list, str, and int values; anything else (e.g. a bool, float, None, tuple) reaches the final elif and raises this TypeError naming the class and the key. GYP build dicts are JSON-like and only support those four value types.","triggerScenarios":"A .gyp file (or a programmatic gyp caller) places a bool, float, None, or tuple as a dict value; JSON config injection that yields null/true/false where GYP expects a string/int; hand-edit introducing a Python-only literal.","commonSituations":"Writing 'something': None or 'flag': True in a .gyp file (GYP has no native boolean — use '1'/'0'); floating-point versions; a templating layer injecting JSON nulls.","solutions":["Replace the offending value with a string or int — e.g. use '1'/'0' or 1/0 instead of True/False, and a string for floats.","Remove the key if it is not meaningful to GYP.","Audit the programmatic caller or .gypi include that produced the value."],"exampleFix":"// before\n'enable_feature': True,\n// after\n'enable_feature': 1,  // or '1'","handlingStrategy":"type-guard","validationCode":"for key, value in the_dict.items():\n    assert isinstance(value, (dict, list, str, int)), \\\n        f'Value for {key!r} has unsupported type {type(value).__name__}'","typeGuard":"def is_supported_gyp_value(value) -> bool:\n    return isinstance(value, (dict, list, str, int)) and not isinstance(value, bool)","tryCatchPattern":null,"preventionTips":["GYP has no native boolean — use '1'/'0' or 1/0.","Avoid None/null values in .gyp and .gypi files.","Lint programmatic gyp callers to emit only dict/list/str/int."],"tags":["gyp","type-check","syntax","build-config"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}