{"record":{"id":"910b96a36cc14bb8","repo":"projectdiscovery/nuclei","slug":"invalid-action-type-s","errorCode":null,"errorMessage":"Invalid action type: %s","messagePattern":"Invalid action type: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/protocols/headless/engine/action_types.go","lineNumber":189,"sourceCode":"}\n\n// GetSupportedActionTypes returns list of supported types\nfunc GetSupportedActionTypes() []ActionType {\n\tvar result []ActionType\n\tfor index := ActionType(1); index < limit; index++ {\n\t\tresult = append(result, index)\n\t}\n\treturn result\n}\n\nfunc toActionTypes(valueToMap string) (ActionType, error) {\n\tnormalizedValue := normalizeValue(valueToMap)\n\tfor key, currentValue := range ActionToActionString {\n\t\tif normalizedValue == currentValue {\n\t\t\treturn key, nil\n\t\t}\n\t}\n\treturn -1, errors.New(\"Invalid action type: \" + valueToMap)\n}\n\nfunc normalizeValue(value string) string {\n\treturn strings.TrimSpace(strings.ToLower(value))\n}\n\nfunc (t ActionType) String() string {\n\treturn ActionToActionString[t]\n}\n\n// ActionTypeHolder is used to hold internal type of the action\ntype ActionTypeHolder struct {\n\tActionType ActionType `mapping:\"true\"`\n}\n\nfunc (holder ActionTypeHolder) String() string {\n\treturn holder.ActionType.String()\n}","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/protocols/headless/engine/action_types.go#L171-L207","documentation":"Headless engine action names in YAML are resolved by toActionTypes, which trims and lowercases the value then matches it against the ActionType enum table. Any name not in ActionToActionString fails template compilation with this error. Valid names include navigate, script, click, rightclick, text, screenshot, time, select, files, waitdom, waitfcp, waitfmp, waitidle, waitload, waitstable, getresource, extract, setmethod, addheader, setheader, deleteheader, setbody, waitevent, waitdialog and more.","triggerScenarios":"A headless template step with a misspelled or unsupported action name, e.g. `action: navigte`, or a Playwright/Puppeteer-style verb like `action: hover` that nuclei does not implement.","commonSituations":"Typos when hand-writing headless templates; porting automation scripts from other browser tools and assuming the same action vocabulary; using newer action names (waitstable, setmethod) on an older nuclei version that predates them.","solutions":["Correct the action name to a supported one from the headless action list (see nuclei docs 'headless-actions')","Run `nuclei -t tpl.yaml -validate` to catch the typo at validation time","If the action exists in current nuclei but not in yours, upgrade nuclei (go install / release binary)"],"exampleFix":"# before\nsteps:\n  - action: navigte\n    url: '{{BaseURL}}'\n\n# after\nsteps:\n  - action: navigate\n    url: '{{BaseURL}}'","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"var supportedActions = map[string]bool{\n  \"navigate\": true, \"script\": true, \"click\": true, \"rightclick\": true,\n  \"text\": true, \"screenshot\": true, \"time\": true, \"select\": true,\n  \"files\": true, \"waitdom\": true, \"waitfcp\": true, \"waitfmp\": true,\n  \"waitidle\": true, \"waitload\": true, \"waitstable\": true, \"getresource\": true,\n  \"extract\": true, \"setmethod\": true, \"addheader\": true, \"setheader\": true,\n  \"deleteheader\": true, \"setbody\": true, \"waitevent\": true, \"waitdialog\": true,\n  \"clickandwait\": true, \"sleep\": true, \"waitfor\": true, \"scrollto\": true,\n}\n\nfunc isValidAction(name string) bool {\n  return supportedActions[strings.ToLower(strings.TrimSpace(name))]\n}","tryCatchPattern":null,"preventionTips":["Validate headless templates with nuclei -validate before deployment","Write action names from the official headless-actions docs, not from Playwright/Puppeteer vocabulary","After upgrading nuclei, re-validate older templates that use recently added actions on new names"],"tags":["headless","yaml","enum","template","validation"],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}