{"record":{"id":"89df33d17b4b1274","repo":"grafana/k6","slug":"wrong-polling-option-value-q-possible-values","errorCode":null,"errorMessage":"wrong polling option value: %q; possible values: \"raf\", \"mutation\" or number","messagePattern":"wrong polling option value: %q; possible values: \"raf\", \"mutation\" or number","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/frame_options.go","lineNumber":671,"sourceCode":"\tobj := opts.ToObject(rt)\n\tfor _, k := range obj.Keys() {\n\t\tv := obj.Get(k)\n\t\tswitch k {\n\t\tcase \"timeout\":\n\t\t\to.Timeout = time.Duration(v.ToInteger()) * time.Millisecond\n\t\tcase \"polling\":\n\t\t\tswitch v.ExportType().Kind() {\n\t\t\tcase reflect.Int64:\n\t\t\t\to.Polling = PollingInterval\n\t\t\t\to.Interval = v.ToInteger()\n\t\t\tcase reflect.String:\n\t\t\t\tif p, ok := pollingTypeToID[v.ToString().String()]; ok {\n\t\t\t\t\to.Polling = p\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tfallthrough\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(\"wrong polling option value: %q; \"+\n\t\t\t\t\t`possible values: \"raf\", \"mutation\" or number`, v)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc NewFrameWaitForLoadStateOptions(defaultTimeout time.Duration) *FrameWaitForLoadStateOptions {\n\treturn &FrameWaitForLoadStateOptions{\n\t\tTimeout: defaultTimeout,\n\t}\n}\n\n// Parse parses the frame waitForLoadState options.\nfunc (o *FrameWaitForLoadStateOptions) Parse(ctx context.Context, opts sobek.Value) error {\n\trt := k6ext.Runtime(ctx)\n\tif !common.IsNullish(opts) {","sourceCodeStart":653,"sourceCodeEnd":689,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/common/frame_options.go#L653-L689","documentation":"Returned while parsing waitForFunction options: the polling value is neither a number (interval) nor one of the recognized strings ('raf', 'mutation'), falling through to the default branch of the type switch. The offending value is included. Pure user-input validation.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/frame_options.go:671 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set polling to 'raf', 'mutation', or a number of milliseconds","Do not pass booleans, objects, or other strings as polling"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}