{"record":{"id":"df6893d822080f8a","repo":"grafana/k6","slug":"protocol-error-while-initializing-worker-t-w","errorCode":null,"errorMessage":"protocol error while initializing worker %T: %w","messagePattern":"protocol error while initializing worker %T: %w","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/worker.go","lineNumber":45,"sourceCode":"\t\ttargetID: id,\n\t\turl:      url,\n\t}\n\tif err := w.initEvents(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &w, nil\n}\n\nfunc (w *Worker) initEvents() error {\n\tactions := []Action{\n\t\tlog.Enable(),\n\t\tnetwork.Enable(),\n\t\truntime.RunIfWaitingForDebugger(),\n\t}\n\tfor _, action := range actions {\n\t\tif err := action.Do(cdp.WithExecutor(w.ctx, w.session)); err != nil {\n\t\t\treturn fmt.Errorf(\"protocol error while initializing worker %T: %w\", action, err)\n\t\t}\n\t}\n\treturn nil\n}\n\n// URL returns the URL of the web worker.\nfunc (w *Worker) URL() string {\n\treturn w.url\n}\n","sourceCodeStart":27,"sourceCodeEnd":55,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/browser/common/worker.go#L27-L55","documentation":"Error \"protocol error while initializing worker %T: %w\" thrown in grafana/k6.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/worker.go:45 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}