{"record":{"id":"6ffa4a5e2c0162de","repo":"mikefarah/yq","slug":"unsupported-node-v-6ffa4a","errorCode":null,"errorMessage":"unsupported node %v","messagePattern":"unsupported node (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/yqlib/encoder_shellvariables.go","lineNumber":89,"sourceCode":"\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\tcase MappingNode:\n\t\tfor index := 0; index < len(node.Content); index = index + 2 {\n\t\t\tkey := node.Content[index]\n\t\t\tvalue := node.Content[index+1]\n\t\t\terr := pe.doEncode(w, value, pe.appendPath(path, key.Value))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\tcase AliasNode:\n\t\treturn pe.doEncode(w, node.Alias, path)\n\tdefault:\n\t\treturn fmt.Errorf(\"unsupported node %v\", node.Tag)\n\t}\n}\n\nfunc (pe *shellVariablesEncoder) appendPath(cookedPath string, rawKey interface{}) string {\n\n\t// Shell variable names must match\n\t//    [a-zA-Z_]+[a-zA-Z0-9_]*\n\t//\n\t// While this is not mandated by POSIX, which is quite lenient, it is\n\t// what shells (for example busybox ash *) allow in practice.\n\t//\n\t// Since yaml names can contain basically any character, we will process them according to these steps:\n\t//\n\t//     1. apply unicode compatibility decomposition NFKD (this will convert accented\n\t//        letters to letters followed by accents, split ligatures, replace exponents\n\t//        with the corresponding digit, etc.\n\t//\n\t//     2. discard non-ASCII characters as well as ASCII control characters (ie. anything","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/mikefarah/yq/blob/8b5af0694bb82b41d4ae180fac9972029066f90a/pkg/yqlib/encoder_shellvariables.go#L71-L107","documentation":"The shell-variables encoder emits each leaf as a shell variable assignment; it handles scalars, maps, sequences, and aliases, and anything else hits 'unsupported node %v' with the node's Tag. Non-standard node kinds cannot be expressed as `name=value` shell variables.","triggerScenarios":"Encoding to `-o shellvariables`/`-o sv` a document whose traversal produces an unhandled Kind — e.g. custom/document nodes created by certain operators — inside doEncode's default branch.","commonSituations":"Generating env-var exports from YAML configs with unusual tagged values; using expressions that return non-standard nodes before encoding; documents with merge/custom type tags that resolve oddly.","solutions":["Simplify the expression to plain maps/scalars, e.g. `yq -o sv '.' config.yaml` without exotic operators.","Retag or stringify suspicious nodes: `.foo |= (tostring)`.","Preview with `-o json` to spot the offending node shape, then normalize it.","Upgrade yq if the node kind should legitimately be supported."],"exampleFix":"# before\nyq -o sv 'custom_op' config.yaml   # produces odd node -> unsupported node\n\n# after\nyq -o sv '.' config.yaml","handlingStrategy":"validation","validationCode":"yq -o json '.' config.yaml > /dev/null && yq '[kind] ' config.yaml   # inspect kinds before -o sv","typeGuard":"null","tryCatchPattern":"yq -o sv '.' config.yaml || { echo \"unsupported node; normalize with tostring/retag\"; }","preventionTips":["Use plain expressions with -o shellvariables (avoid exotic operators)","Stringify suspicious leaf values first","Check kind inventory before encoding"],"tags":["shell","shellvariables","encoder","node-kind"],"backgroundTag":"encoder-unsupported-node-kind","analyzedSha":"8b5af0694bb82b41d4ae180fac9972029066f90a","analyzedAt":"2026-09-05T10:57:22.766Z","contentChangedAt":"2026-09-05T10:57:22.766Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}