{"record":{"id":"980e1dff7f24abef","repo":"grafana/k6","slug":"checking-is-q-checked-unexpected-type-t","errorCode":null,"errorMessage":"checking is %q checked: unexpected type %T","messagePattern":"checking is %q checked: unexpected type %T","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/frame.go","lineNumber":767,"sourceCode":"func (f *Frame) isChecked(selector string, opts *FrameIsCheckedOptions) (bool, error) {\n\tisChecked := func(apiCtx context.Context, handle *ElementHandle) (any, error) {\n\t\tv, err := handle.isChecked(apiCtx, 0) // Zero timeout when checking state\n\t\tif errors.Is(err, ErrTimedOut) {      // We don't care about timeout errors here!\n\t\t\treturn v, nil\n\t\t}\n\t\treturn v, err\n\t}\n\tact := f.newAction(\n\t\tselector, DOMElementStateAttached, opts.Strict, isChecked, []string{}, false, withRetry, true, opts.Timeout,\n\t)\n\tv, err := call(f.ctx, act, opts.Timeout)\n\tif err != nil {\n\t\treturn false, errorFromDOMError(err)\n\t}\n\n\tbv, ok := v.(bool)\n\tif !ok {\n\t\treturn false, fmt.Errorf(\"checking is %q checked: unexpected type %T\", selector, v)\n\t}\n\n\treturn bv, nil\n}\n\n// Content returns the HTML content of the frame.\nfunc (f *Frame) Content() (string, error) {\n\tf.log.Debugf(\"Frame:Content\", \"fid:%s furl:%q\", f.ID(), f.URL())\n\n\tjs := `() => {\n\t\tlet content = '';\n\t\tif (document.doctype) {\n\t\t\tcontent = new XMLSerializer().serializeToString(document.doctype);\n\t\t}\n\t\tif (document.documentElement) {\n\t\t\tcontent += document.documentElement.outerHTML;\n\t\t}\n\t\treturn content;","sourceCodeStart":749,"sourceCodeEnd":785,"githubUrl":"https://github.com/grafana/k6/blob/3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee/internal/js/modules/k6/browser/common/frame.go#L749-L785","documentation":"Returned by Frame.isChecked as a type guard: the state-read action returned a value that is not a bool. The injected isChecked evaluation should always yield boolean; a different Go type indicates an internal contract break, reported with the selector and actual type.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/frame.go:759 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Report as a k6 browser module bug if reproducible","Retry in case of a transient evaluation anomaly"],"exampleFix":null,"handlingStrategy":"type-guard","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"}