{"record":{"id":"ecbc8a1dd64af318","repo":"projectdiscovery/nuclei","slug":"event-not-recognized","errorCode":null,"errorMessage":"event not recognized","messagePattern":"event not recognized","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/protocols/headless/engine/page_actions.go","lineNumber":870,"sourceCode":"\t\t\treturn errors.Wrap(err, \"could not get element text node\")\n\t\t}\n\n\t\tif act.Name != \"\" {\n\t\t\tout[act.Name] = text\n\t\t}\n\t}\n\treturn nil\n}\n\n// WaitEvent waits for an event to happen on the page.\nfunc (p *Page) WaitEvent(act *Action, out ActionData) (func() error, error) {\n\tevent, err := p.getActionArg(act, \"event\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif event == \"\" {\n\t\treturn nil, errors.New(\"event not recognized\")\n\t}\n\n\tvar waitEvent proto.Event\n\n\tgotType := proto.GetType(event)\n\tif gotType == nil {\n\t\treturn nil, errkit.Newf(\"event %q does not exist\", event)\n\t}\n\n\ttmp, ok := reflect.New(gotType).Interface().(proto.Event)\n\tif !ok {\n\t\treturn nil, errkit.Newf(\"event %q is not a page event\", event)\n\t}\n\n\twaitEvent = tmp\n\n\t// allow user to specify max-duration for wait-event\n\tmaxDuration, err := getTimeParameter(p, act, \"max-duration\", 5, time.Second)","sourceCodeStart":852,"sourceCodeEnd":888,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/protocols/headless/engine/page_actions.go#L852-L888","documentation":"The waitevent action requires an `event` arg naming a Chrome DevTools Protocol event. An empty value returns 'event not recognized' immediately; a non-empty but unknown name proceeds to proto.GetType and fails with 'event %q does not exist' or 'is not a page event'. So this specific message means the arg is missing entirely.","triggerScenarios":"A step with `action: waitevent` that omits the `event:` arg (or leaves it empty). Distinct from the follow-on errors caused by wrong names like `event: pageload` instead of the CDP form `event: Page.loadEventFired`.","commonSituations":"Authors guessing event names from web-DOM events (load, click) rather than CDP domain events (Page.loadEventFired, Network.responseReceived); template edits dropping the event line.","solutions":["Set the event arg to a full CDP event name with domain, e.g. `event: Page.loadEventFired`","Consult the Chrome DevTools Protocol viewer for valid domain.event identifiers","Validate the template with `nuclei -t tpl.yaml -validate`"],"exampleFix":"# before\n- action: waitevent\n\n# after\n- action: waitevent\n  event: Page.loadEventFired","handlingStrategy":"validation","validationCode":"// programmatic check\nif act.ActionType == engine.ActionWaitEvent {\n    if strings.TrimSpace(act.GetArg(\"event\")) == \"\" {\n        return errors.New(\"waitevent step is missing the event arg\")\n    }\n}","typeGuard":"func isValidCDPEvent(name string) bool {\n    return proto.GetType(name) != nil\n}","tryCatchPattern":null,"preventionTips":["Use fully-qualified CDP names like Page.loadEventFired, never DOM event names","Cross-check event names against the Chrome DevTools Protocol schema (proto package / CDP viewer)"],"tags":["headless","cdp","template","waitevent"],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}