{"record":{"id":"4b8f6f95b32ef7f8","repo":"nodejs/node","slug":"unhandled-output-type-s","errorCode":null,"errorMessage":"Unhandled output type %s","messagePattern":"Unhandled output type (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"tools/gyp/pylib/gyp/generator/ninja.py","lineNumber":1835,"sourceCode":"            target = spec[\"product_name\"]\n        else:\n            # Otherwise, derive a name from the target name.\n            target = spec[\"target_name\"]\n            if prefix == \"lib\":\n                # Snip out an extra 'lib' from libs if appropriate.\n                target = StripPrefix(target, \"lib\")\n\n        if type in (\n            \"static_library\",\n            \"loadable_module\",\n            \"shared_library\",\n            \"executable\",\n        ):\n            return f\"{prefix}{target}{extension}\"\n        elif type == \"none\":\n            return \"%s.stamp\" % target\n        else:\n            raise Exception(\"Unhandled output type %s\" % type)\n\n    def ComputeOutput(self, spec, arch=None):\n        \"\"\"Compute the path for the final output of the spec.\"\"\"\n        type = spec[\"type\"]\n\n        if self.flavor == \"win\":\n            override = self.msvs_settings.GetOutputName(\n                self.config_name, self.ExpandSpecial\n            )\n            if override:\n                return override\n\n        if (\n            arch is None\n            and self.flavor == \"mac\"\n            and type\n            in (\"static_library\", \"executable\", \"shared_library\", \"loadable_module\")\n        ):","sourceCodeStart":1817,"sourceCodeEnd":1853,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/tools/gyp/pylib/gyp/generator/ninja.py#L1817-L1853","documentation":"Raised as an Exception by the ninja generator's type-specific output path helper when a target's type is not one of the handled kinds (static_library, loadable_module, shared_library, executable, none). There is no fallback output naming rule, so an unknown type cannot produce a build artifact path.","triggerScenarios":"A target with spec['type'] set to a value outside the handled set reaches the ninja ComputeOutput-by-type code at ninja.py:1831 and falls to the `else` branch. Typically a typo, a custom type, or a type only valid for another generator that leaked into a ninja build.","commonSituations":"Typo in the type field; a target type introduced for a different build system; conditional type logic that yields an unexpected value under ninja.","solutions":["Set the target type to a supported value: static_library, loadable_module, shared_library, executable, or none.","Gate targets whose type is non-standard so they are excluded from the ninja build.","Check for typos such as 'static_lib' vs 'static_library'."],"exampleFix":"// before\n'targets': [{ 'target_name': 'foo', 'type': 'static_lib' }]\n// after\n'targets': [{ 'target_name': 'foo', 'type': 'static_library' }]","handlingStrategy":"validation","validationCode":"VALID = {'static_library','loadable_module','shared_library','executable','none'}\nif spec['type'] not in VALID:\n    raise ValueError(f\"unhandled output type: {spec['type']}\")","typeGuard":"VALID = {'static_library','loadable_module','shared_library','executable','none'}\ndef is_handled_ninja_type(spec) -> bool:\n    return spec.get('type') in VALID","tryCatchPattern":null,"preventionTips":["Use only supported target types for ninja builds.","Exclude non-standard targets from ninja generation via conditions."],"tags":["gyp","ninja","target-type","validation"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}