{"record":{"id":"1db77a96a368e120","repo":"grafana/k6","slug":"parse-isdisabled-options-of-selector-q-w","errorCode":null,"errorMessage":"parse isDisabled options of selector %q: %w","messagePattern":"parse isDisabled options of selector %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/browser/page_mapping.go","lineNumber":301,"sourceCode":"\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn p.InputValue(selector, popts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"isChecked\": func(selector string, opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tpopts, err := parseFrameIsCheckedOptions(rt, opts, p.MainFrame().Timeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parse isChecked options of selector %q: %w\", selector, err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn p.IsChecked(selector, popts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"isClosed\": p.IsClosed,\n\t\t\"isDisabled\": func(selector string, opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tpopts, err := parseFrameIsDisabledOptions(rt, opts, p.MainFrame().Timeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parse isDisabled options of selector %q: %w\", selector, err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn p.IsDisabled(selector, popts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"isEditable\": func(selector string, opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tpopts, err := parseFrameIsEditableOptions(rt, opts, p.MainFrame().Timeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parse isEditabled options of selector %q: %w\", selector, err)\n\t\t\t}\n\t\t\treturn promise(vu, func() (any, error) {\n\t\t\t\treturn p.IsEditable(selector, popts) //nolint:wrapcheck\n\t\t\t}), nil\n\t\t},\n\t\t\"isEnabled\": func(selector string, opts sobek.Value) (*sobek.Promise, error) {\n\t\t\tpopts, err := parseFrameIsEnabledOptions(rt, opts, p.MainFrame().Timeout())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"parse isEnabled options of selector %q: %w\", selector, err)","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/grafana/k6/blob/8d06114777191d21ef885d05c5f8aa9e1ed838ae/internal/js/modules/k6/browser/browser/page_mapping.go#L283-L319","documentation":"Thrown synchronously by page.isDisabled(selector, opts) when FrameIsDisabledOptions.Parse fails. The embedded FrameBaseOptions.Parse (internal/js/modules/k6/browser/common/frame_options.go:218-232) coerces strict/timeout and always returns nil, so on stock k6 this wrapper cannot fire; invalid timeout values coerce to 0ms instead of erroring. The selector is included in the message.","triggerScenarios":"Not reachable with current stock code; would require a build whose FrameBaseOptions.Parse validates types.","commonSituations":"Forked browser modules or newer versions with added type validation.","solutions":["Pass only strict and timeout (integer ms)","Omit opts entirely","Match your build's option schema if customized"],"exampleFix":"// before\nawait page.isDisabled('#btn', { timeout: '1s' });\n\n// after\nawait page.isDisabled('#btn', { timeout: 1000 });","handlingStrategy":"validation","validationCode":"const ALLOWED = new Set(['timeout', 'strict']);\nconst bad = Object.keys(opts ?? {}).filter(k => !ALLOWED.has(k));\nif (bad.length) console.warn(`isDisabled ignores unknown options: ${bad.join(', ')}`);\nif (opts?.timeout !== undefined && !Number.isInteger(opts.timeout)) {\n  throw new Error('isDisabled timeout must be integer milliseconds');\n}\nawait page.isDisabled(selector, opts);","typeGuard":"/** @param {unknown} o */\nfunction isBaseOpts(o) {\n  if (o === undefined || o === null) return true;\n  if (typeof o !== 'object') return false;\n  const t = /** @type {any} */ (o);\n  return (t.timeout === undefined || Number.isInteger(t.timeout))\n    && (t.strict === undefined || typeof t.strict === 'boolean');\n}","tryCatchPattern":"try {\n  return await page.isDisabled(selector, opts);\n} catch (e) {\n  if (String(e).includes('isDisabled options')) {\n    return await page.isDisabled(selector);\n  } throw e;\n}","preventionTips":["isDisabled reads only timeout and strict","Integer milliseconds for timeout, never strings","Reuse one shared option constant across the is* family"],"tags":["k6","browser","page","is-disabled","options"],"backgroundTag":"invalid-option-type","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"}