{"record":{"id":"84495d8c338df928","repo":"grafana/k6","slug":"error-parsing-browser-options-w","errorCode":null,"errorMessage":"error parsing browser options: %w","messagePattern":"error parsing browser options: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/chromium/browser_type.go","lineNumber":93,"sourceCode":"func (b *BrowserType) init(\n\tctx context.Context, isRemoteBrowser bool, scenarioOpts map[string]any,\n) (context.Context, *common.BrowserOptions, *log.Logger, error) {\n\tctx = b.initContext(ctx)\n\n\tlogger, err := makeLogger(ctx, b.envLookupper)\n\tif err != nil {\n\t\treturn nil, nil, nil, fmt.Errorf(\"error setting up logger: %w\", err)\n\t}\n\n\tvar browserOpts *common.BrowserOptions\n\tif isRemoteBrowser {\n\t\tbrowserOpts = common.NewRemoteBrowserOptions()\n\t} else {\n\t\tbrowserOpts = common.NewLocalBrowserOptions()\n\t}\n\n\tif err = browserOpts.Parse(ctx, logger, scenarioOpts, b.envLookupper); err != nil {\n\t\treturn nil, nil, nil, fmt.Errorf(\"error parsing browser options: %w\", err)\n\t}\n\tctx = common.WithBrowserOptions(ctx, browserOpts)\n\n\tif err := logger.SetCategoryFilter(browserOpts.LogCategoryFilter); err != nil {\n\t\treturn nil, nil, nil, fmt.Errorf(\"error setting category filter: %w\", err)\n\t}\n\tif browserOpts.Debug {\n\t\t_ = logger.SetLevel(\"debug\")\n\t}\n\n\treturn ctx, browserOpts, logger, nil\n}\n\nfunc (b *BrowserType) initContext(ctx context.Context) context.Context {\n\tctx = k6ext.WithVU(ctx, b.vu)\n\tctx = k6ext.WithCustomMetrics(ctx, b.k6Metrics)\n\tctx = common.WithHooks(ctx, b.hooks)\n\tctx = common.WithIterationID(ctx, fmt.Sprintf(\"%x\", b.randSrc.Uint64()))","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/grafana/k6/blob/8d06114777191d21ef885d05c5f8aa9e1ed838ae/internal/js/modules/k6/browser/chromium/browser_type.go#L75-L111","documentation":"BrowserOptions.Parse rejected the combined browser configuration: options from the scenario definition merged with K6_BROWSER_* environment variables. Any earlier invalid option (bad timeout, bad headless flag, unsupported type, etc.) surfaces here, wrapped by BrowserType.init during Launch/Connect/ConnectOverCDP.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/chromium/browser_type.go:93 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error for the specific option at fault","Validate all K6_BROWSER_* env vars (e.g. K6_BROWSER_TIMEOUT='30s', K6_BROWSER_HEADLESS=true)","Check the browser scenario options block for typos or unsupported keys"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8d06114777191d21ef885d05c5f8aa9e1ed838ae","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}