{"record":{"id":"8b1043062fe7cca3","repo":"nodejs/node","slug":"s-not-allowed-in-the-s-configuration-found-in-t","errorCode":null,"errorMessage":"%s not allowed in the %s configuration, found in target %s","messagePattern":"(.+?) not allowed in the (.+?) configuration, found in target (.+?)","errorType":"exception","errorClass":"GypError","httpStatus":null,"severity":"error","filePath":"tools/gyp/pylib/gyp/input.py","lineNumber":2485,"sourceCode":"\n    # Now that all of the target's configurations have been built, go through\n    # the target dict's keys and remove everything that's been moved into a\n    # \"configurations\" section.\n    delete_keys = []\n    for key in target_dict:\n        key_ext = key[-1:]\n        key_base = key[:-1] if key_ext in key_suffixes else key\n        if key_base not in non_configuration_keys:\n            delete_keys.append(key)\n    for key in delete_keys:\n        del target_dict[key]\n\n    # Check the configurations to see if they contain invalid keys.\n    for configuration in target_dict[\"configurations\"]:\n        configuration_dict = target_dict[\"configurations\"][configuration]\n        for key in configuration_dict:\n            if key in invalid_configuration_keys:\n                raise GypError(\n                    \"%s not allowed in the %s configuration, found in \"\n                    \"target %s\" % (key, configuration, target)\n                )\n\n\ndef ProcessListFiltersInDict(name, the_dict):\n    \"\"\"Process regular expression and exclusion-based filters on lists.\n\n    An exclusion list is in a dict key named with a trailing \"!\", like\n    \"sources!\".  Every item in such a list is removed from the associated\n    main list, which in this example, would be \"sources\".  Removed items are\n    placed into a \"sources_excluded\" list in the dict.\n\n    Regular expression (regex) filters are contained in dict keys named with a\n    trailing \"/\", such as \"sources/\" to operate on the \"sources\" list.  Regex\n    filters in a dict take the form:\n      'sources/': [ ['exclude', '_(linux|mac|win)\\\\.cc$'],\n                    ['include', '_mac\\\\.cc$'] ],","sourceCodeStart":2467,"sourceCodeEnd":2503,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/tools/gyp/pylib/gyp/input.py#L2467-L2503","documentation":"After splitting target-level keys out of configurations, gyp validates that no key listed in invalid_configuration_keys appears inside any configuration dict. invalid_configuration_keys includes actions, all_dependent_settings, configurations, dependencies, direct_dependent_settings, libraries, link_settings, sources, standalone_static_library, target_name, type — these belong at the TARGET level, not inside a configuration.","triggerScenarios":"A 'configurations' entry dict contains one of the forbidden keys (e.g. 'sources', 'dependencies', 'type', 'target_name'). The loop at input.py:~2485 raises GypError naming the key, the configuration name, and the target.","commonSituations":"Indentation mistake that nested target-level keys under a configuration; copy-pasting a target block into a configuration; misunderstanding that sources/dependencies are target-scoped; migrating from a generator that was lenient.","solutions":["Move the offending key (sources, dependencies, type, etc.) out of the configuration dict to the target level.","Keep only compiler/linker settings (cflags, defines, include_dirs, ldflags, etc.) inside configurations.","Fix indentation so configuration keys are siblings, not children, of target keys.","Run gyp --check to catch placement errors early."],"exampleFix":"// before\n{ 'target_name':'foo', 'type':'static_library',\n  'configurations': { 'Debug': { 'sources': ['a.cc'], 'defines':['DEBUG'] } } }\n// after\n{ 'target_name':'foo', 'type':'static_library', 'sources': ['a.cc'],\n  'configurations': { 'Debug': { 'defines':['DEBUG'] } } }","handlingStrategy":"validation","validationCode":"INVALID = {'actions','all_dependent_settings','configurations','dependencies','direct_dependent_settings','libraries','link_settings','sources','standalone_static_library','target_name','type'}\nfor cfg, cd in target_dict.get('configurations', {}).items():\n    bad = INVALID & set(cd)\n    assert not bad, 'invalid keys in config %s: %r' % (cfg, bad)\n","typeGuard":null,"tryCatchPattern":"try:\n    gyp.main(args)\nexcept gyp.input.GypError as e:\n    if 'not allowed in the' in str(e) and 'configuration' in str(e): print('Move target-level keys out of configurations'); raise","preventionTips":["Keep only compiler/linker settings inside configurations.","Move sources/dependencies/type to the target level.","Use consistent indentation and lint placement."],"tags":["gyp","configuration","validation","build-config"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}