{"record":{"id":"ee5142637e331b51","repo":"grafana/k6","slug":"getting-bounding-box-of-q-unexpected-type-t","errorCode":null,"errorMessage":"getting bounding box of %q: unexpected type %T","messagePattern":"getting bounding box of %q: unexpected type %T","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/frame.go","lineNumber":594,"sourceCode":"\n\treturn handle, err\n}\n\nfunc (f *Frame) boundingBox(selector string, opts *FrameBaseOptions) (*Rect, error) {\n\tgetBoundingBox := func(apiCtx context.Context, handle *ElementHandle) (any, error) {\n\t\treturn handle.BoundingBox()\n\t}\n\tact := f.newAction(\n\t\tselector, DOMElementStateAttached, opts.Strict, getBoundingBox, []string{}, false, noRetry, true, opts.Timeout,\n\t)\n\tv, err := call(f.ctx, act, opts.Timeout)\n\tif err != nil {\n\t\treturn nil, errorFromDOMError(err)\n\t}\n\n\tbv, ok := v.(*Rect)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"getting bounding box of %q: unexpected type %T\", selector, v)\n\t}\n\n\treturn bv, nil\n}\n\n// ChildFrames returns a list of child frames.\nfunc (f *Frame) ChildFrames() []*Frame {\n\tf.childFramesMu.RLock()\n\tdefer f.childFramesMu.RUnlock()\n\n\tl := make([]*Frame, 0, len(f.childFrames))\n\tfor child := range f.childFrames {\n\t\tl = append(l, child)\n\t}\n\treturn l\n}\n\n// Click clicks the first element found that matches selector.","sourceCodeStart":576,"sourceCodeEnd":612,"githubUrl":"https://github.com/grafana/k6/blob/3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee/internal/js/modules/k6/browser/common/frame.go#L576-L612","documentation":"Returned by Frame.boundingBox as a type guard: the action pipeline returned a value for the bounding box that is not *Rect. Since handle.BoundingBox returns *Rect, this indicates an internal anomaly (wrong responder wired into the action), reported with the selector and actual Go type.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/frame.go:586 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Report as a k6 browser module bug with a reproducing script","Retry in case of a transient 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"}