{"record":{"id":"2a57f1048fd50cda","repo":"grafana/k6","slug":"internal-error-while-enabling-t-w","errorCode":null,"errorMessage":"internal error while enabling %T: %w","messagePattern":"internal error while enabling %T: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/frame_session.go","lineNumber":261,"sourceCode":"\t}\n\treturn nil\n}\n\nfunc (fs *FrameSession) getNetworkManager() *NetworkManager {\n\treturn fs.networkManager\n}\n\nfunc (fs *FrameSession) initDomains() error {\n\tactions := []Action{\n\t\t// TODO: can we get rid of the following by doing DOM related stuff in JS instead?\n\t\tdom.Enable(),\n\t\tcdplog.Enable(),\n\t\tcdpruntime.Enable(),\n\t\ttarget.SetAutoAttach(true, true).WithFlatten(true),\n\t}\n\tfor _, action := range actions {\n\t\tif err := action.Do(cdp.WithExecutor(fs.ctx, fs.session)); err != nil {\n\t\t\treturn fmt.Errorf(\"internal error while enabling %T: %w\", action, err)\n\t\t}\n\t}\n\treturn nil\n}\n\n//nolint:cyclop,funlen\nfunc (fs *FrameSession) initEvents() {\n\tfs.logger.Debugf(\"NewFrameSession:initEvents\",\n\t\t\"sid:%v tid:%v\", fs.session.ID(), fs.targetID)\n\n\tevents := []string{\n\t\tcdproto.EventInspectorTargetCrashed,\n\t}\n\tfs.session.on(fs.ctx, events, fs.eventCh)\n\tif !fs.isMainFrame() {\n\t\tfs.initRendererEvents()\n\t}\n","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/grafana/k6/blob/3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee/internal/js/modules/k6/browser/common/frame_session.go#L243-L279","documentation":"During initDomains, one of the initial CDP domain-enable actions (DOM.enable, Log.enable, Runtime.enable, Target.setAutoAttach) failed. These are prerequisites for frame session operation; the error is wrapped with the action's Go type identifying which domain failed. Marked 'internal error' because enable calls should not fail on a healthy session.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/frame_session.go:232 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped CDP error to see which domain failed and why","Update k6 and the Chromium version — CDP protocol mismatches can break domain enable","Check browser startup logs for crashes or resource exhaustion"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}