{"record":{"id":"c4fbb01f1ab9b2d9","repo":"grafana/k6","slug":"checking-is-q-disabled-unexpected-type-t","errorCode":null,"errorMessage":"checking is %q disabled: unexpected type %T","messagePattern":"checking is %q disabled: unexpected type %T","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/frame.go","lineNumber":1520,"sourceCode":"func (f *Frame) isDisabled(selector string, opts *FrameIsDisabledOptions) (bool, error) {\n\tisDisabled := func(apiCtx context.Context, handle *ElementHandle) (any, error) {\n\t\tv, err := handle.isDisabled(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, isDisabled, []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 disabled: unexpected type %T\", selector, v)\n\t}\n\n\treturn bv, nil\n}\n\n// IsHidden returns true if the first element that matches the selector\n// is hidden. Otherwise, returns false.\nfunc (f *Frame) IsHidden(selector string, opts *FrameIsHiddenOptions) (bool, error) {\n\tf.log.Debugf(\"Frame:IsHidden\", \"fid:%s furl:%q sel:%q\", f.ID(), f.URL(), selector)\n\n\thidden, err := f.isHidden(selector, opts)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\treturn hidden, nil\n}\n","sourceCodeStart":1502,"sourceCodeEnd":1538,"githubUrl":"https://github.com/grafana/k6/blob/3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee/internal/js/modules/k6/browser/common/frame.go#L1502-L1538","documentation":"Returned by Frame.isDisabled as a type guard: the disabled-state evaluation returned a non-bool value. The injected script contract (boolean result) was broken; the actual Go type is reported alongside the selector.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/frame.go:1512 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the check after the page settles","Report as a k6 browser module bug if reproducible"],"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"}