{"record":{"id":"800861fe59159d61","repo":"grafana/k6","slug":"parsing-is-editable-options-w","errorCode":null,"errorMessage":"parsing is editable options: %w","messagePattern":"parsing is editable options: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/browser/locator_mapping.go","lineNumber":149,"sourceCode":"\t\t\t\treturn nil, fmt.Errorf(\"parsing uncheck options: %w\", err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn nil, lo.Uncheck(copts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"isChecked\": func(opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tcopts, err := parseFrameIsCheckedOptions(rt, opts, lo.Timeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing is checked options: %w\", err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn lo.IsChecked(copts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"isEditable\": func(opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tcopts, err := parseFrameIsEditableOptions(rt, opts, lo.Timeout())\n\t\t\tif err != nil {\n\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)","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/grafana/k6/blob/8d06114777191d21ef885d05c5f8aa9e1ed838ae/internal/js/modules/k6/browser/browser/locator_mapping.go#L131-L167","documentation":"Thrown synchronously when the options argument to locator.isEditable() fails to parse. The mapping (locator_mapping.go:146-150) builds common.FrameIsEditableOptions (FrameBaseOptions with the locator timeout) and wraps any Parse failure as \"parsing is editable options: %w\". FrameBaseOptions.Parse only reads strict and timeout with coercing accessors and returns nil, so in practice the wrapped error comes from sobek raising while enumerating or reading the options object (throwing getter, Proxy trap, or throwing coercion).","triggerScenarios":"opts with a throwing getter for timeout or strict (Object.defineProperty or class accessor); a Proxy around the options object whose ownKeys/get trap raises; a timeout value whose toPrimitive/valueOf throws during ToInteger coercion.","commonSituations":"Lazy page-object config getters that throw on missing values; argument-intercepting Proxies from debug/tracing harnesses; passing non-plain objects (class instances with accessors) where a literal is expected.","solutions":["Call locator.isEditable() with no options or a plain literal: { timeout: 3000 }","Resolve dynamic values before the call so options are plain data","Unwrap Proxies before passing options to browser APIs","Wrap the call in try/catch and fail fast with a descriptive error"],"exampleFix":"// before\nclass Opts { get timeout() { return this.cfg?.timeout; } }\nawait locator.isEditable(new Opts());\n\n// after\nconst timeout = cfg?.timeout ?? 3000;\nawait locator.isEditable({ 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 editable = await locator.isEditable(opts);\n} catch (e) {\n  throw new Error(`isEditable failed (check timeout/strict getters): ${e}`);\n}","preventionTips":["Precompute timeout values into plain properties","Call isEditable() with no args when defaults are fine","Never let config getters throw inside option objects"],"tags":["k6","browser","locator","iseditable","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"}