{"record":{"id":"15042a86d78a4f9f","repo":"grafana/k6","slug":"enabling-page-domain-w","errorCode":null,"errorMessage":"enabling page domain: %w","messagePattern":"enabling page domain: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/frame_session.go","lineNumber":477,"sourceCode":"\t// it seems to pause the exec of any other action on\n\t// the page. I believe this is an issue in Chromium.\n\taction := cdppage.HandleJavaScriptDialog(false)\n\tif event.Type == cdppage.DialogTypeBeforeunload {\n\t\taction = cdppage.HandleJavaScriptDialog(true)\n\t}\n\n\tif err := action.Do(cdp.WithExecutor(fs.ctx, fs.session)); err != nil {\n\t\tfs.logger.Errorf(\"FrameSession:onEventJavascriptDialogOpening\", \"failed to dismiss dialog box: %v\", err)\n\t}\n}\n\nfunc (fs *FrameSession) initFrameTree() error {\n\tfs.logger.Debugf(\"NewFrameSession:initFrameTree\",\n\t\t\"sid:%v tid:%v\", fs.session.ID(), fs.targetID)\n\n\taction := cdppage.Enable()\n\tif err := action.Do(cdp.WithExecutor(fs.ctx, fs.session)); err != nil {\n\t\treturn fmt.Errorf(\"enabling page domain: %w\", err)\n\t}\n\n\tvar frameTree *cdppage.FrameTree\n\tvar err error\n\n\t// Recursively enumerate all existing frames in page to create initial in-memory structures\n\t// used for access and manipulation from JS.\n\taction2 := cdppage.GetFrameTree()\n\tif frameTree, err = action2.Do(cdp.WithExecutor(fs.ctx, fs.session)); err != nil {\n\t\treturn fmt.Errorf(\"getting page frame tree: %w\", err)\n\t} else if frameTree == nil {\n\t\t// This can happen with very short scripts when we might not have enough\n\t\t// time to initialize properly.\n\t\treturn fmt.Errorf(\"got a nil page frame tree\")\n\t}\n\n\t// Any new frame may have a child frame, not just mainframes.\n\tfs.handleFrameTree(frameTree, fs.isMainFrame())","sourceCodeStart":459,"sourceCodeEnd":495,"githubUrl":"https://github.com/grafana/k6/blob/3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee/internal/js/modules/k6/browser/common/frame_session.go#L459-L495","documentation":"During initFrameTree, the Page.enable CDP call failed, so the Page domain (needed for navigation, frame tree, dialogs) could not be enabled for this session. The wrapped error is Chromium's; frame session setup aborts.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/frame_session.go:424 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped CDP error for Chromium's reason","Check browser health and logs (crashes, too many targets)","Update k6/Chromium and retry"],"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"}