{"record":{"id":"d79567c6ae3d63a9","repo":"grafana/k6","slug":"unexpected-event-data-type-t-expected-navigati","errorCode":null,"errorMessage":"unexpected event data type: %T, expected *NavigationEvent","messagePattern":"unexpected event data type: %T, expected \\*NavigationEvent","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/page.go","lineNumber":1578,"sourceCode":"\t\t}\n\t\tp.logger.Debugf(\"Page:Reload\", \"timeoutCtx done: %v\", err)\n\n\t\treturn err\n\t}\n\n\tvar (\n\t\tnavigationEvent *NavigationEvent\n\t\terr             error\n\t)\n\tselect {\n\tcase <-p.ctx.Done():\n\t\terr = ContextErr(p.ctx)\n\tcase <-timeoutCtx.Done():\n\t\terr = wrapTimeoutError(ContextErr(timeoutCtx))\n\tcase event := <-waitForFrameNavigation:\n\t\tvar ok bool\n\t\tif navigationEvent, ok = event.(*NavigationEvent); !ok {\n\t\t\terr = fmt.Errorf(\"unexpected event data type: %T, expected *NavigationEvent\", event)\n\t\t} else if navigationEvent != nil && navigationEvent.err != nil {\n\t\t\terr = navigationEvent.err\n\t\t}\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar resp *Response\n\n\t// Sometimes the new document is not yet available when the navigation event is emitted.\n\tnewDocument := navigationEvent.newDocument\n\tif newDocument != nil && newDocument.request != nil {\n\t\treq := newDocument.request\n\t\treq.responseMu.RLock()\n\t\tresp = req.response\n\t\treq.responseMu.RUnlock()\n\t}","sourceCodeStart":1560,"sourceCodeEnd":1596,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/common/page.go#L1560-L1596","documentation":"Type-assertion guard in the page navigation wait: the value received on the waitForFrameNavigation channel is not a *NavigationEvent as expected, meaning an event of a different concrete type was emitted on that channel. This is an internal invariant violation rather than a user input error.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/page.go:1578 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the navigation (waitForNavigation) — usually a one-off event-ordering anomaly","Report as a k6/browser bug with a reproducing script if it recurs","Avoid concurrent navigation-triggering actions on the same page"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}