{"record":{"id":"c5cb2bc0d9a41f83","repo":"grafana/k6","slug":"parsing-is-disabled-options-w","errorCode":null,"errorMessage":"parsing is disabled options: %w","messagePattern":"parsing is disabled options: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/browser/locator_mapping.go","lineNumber":167,"sourceCode":"\t\t\t\treturn nil, fmt.Errorf(\"parsing is editable options: %w\", err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn lo.IsEditable(copts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"isEnabled\": func(opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tcopts, err := parseFrameIsEnabledOptions(rt, opts, lo.Timeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing is enabled options: %w\", err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn lo.IsEnabled(copts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"isDisabled\": func(opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tcopts, err := parseFrameIsDisabledOptions(rt, opts, lo.Timeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing is disabled options: %w\", err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn lo.IsDisabled(copts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"isInViewport\": func(opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tcopts, err := parseFrameIsInViewportOptions(rt, opts, lo.Timeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing is in viewport options: %w\", err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn lo.IsInViewport(copts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"isVisible\": func() *sobek.Promise {\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn lo.IsVisible() //nolint:wrapcheck\n\t\t\t})","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/grafana/k6/blob/8d06114777191d21ef885d05c5f8aa9e1ed838ae/internal/js/modules/k6/browser/browser/locator_mapping.go#L149-L185","documentation":"Thrown synchronously when the options argument to locator.isDisabled() fails to parse. The mapping (locator_mapping.go:164-168) builds common.FrameIsDisabledOptions (FrameBaseOptions) and re-wraps Parse errors as \"parsing is disabled options: %w\". FrameBaseOptions.Parse only touches strict (boolean coercion) and timeout (integer coercion), so an actual error means sobek raised while reading the object — a throwing getter on those keys, a Proxy trap, or a toPrimitive/valueOf that throws.","triggerScenarios":"A getter for timeout or strict that raises; Proxy options whose get/ownKeys traps throw; a non-number timeout whose coercion method throws (e.g. an object with valueOf() { throw ... }).","commonSituations":"Argument-inspecting harnesses built on Proxy; config objects with validation getters; ported Playwright helpers that decorate option objects with accessors.","solutions":["Use a plain object literal: locator.isDisabled({ timeout: 5000 }) or no argument","Materialize computed options into plain values before the call","Strip Proxies/accessors from anything passed to browser APIs","try/catch the call to surface a clean failure message"],"exampleFix":"// before\nconst opts = { get timeout() { return computeTimeout(); } }; // computeTimeout throws when config missing\nawait locator.isDisabled(opts);\n\n// after\nconst timeout = computeTimeout();\nawait locator.isDisabled({ timeout });","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"function isPlainBaseOptions(o) {\n  return o == null || (typeof o === 'object' &&\n    (o.timeout === undefined || typeof o.timeout === 'number') &&\n    (o.strict === undefined || typeof o.strict === 'boolean'));\n}","tryCatchPattern":"try {\n  const disabled = await locator.isDisabled(opts);\n} catch (e) {\n  throw new Error(`isDisabled failed (options must be plain data): ${e}`);\n}","preventionTips":["Replace accessor properties with plain values computed up front","Prefer calling isDisabled() with no options","Guard config lookups so they never throw inside getters"],"tags":["k6","browser","locator","isdisabled","options"],"backgroundTag":"invalid-options-object","analyzedSha":"8d06114777191d21ef885d05c5f8aa9e1ed838ae","analyzedAt":"2026-09-14T20:10:14.619Z","contentChangedAt":"2026-09-14T20:10:14.619Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}