{"record":{"id":"05c5aae4f4b74561","repo":"grafana/k6","slug":"invalid-longitude-2f-precondition-180-lon","errorCode":null,"errorMessage":"invalid longitude \"%.2f\": precondition -180 <= LONGITUDE <= 180 failed","messagePattern":"invalid longitude \"%\\.2f\": precondition -180 <= LONGITUDE <= 180 failed","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/browser_context_options.go","lineNumber":76,"sourceCode":"\tServer string `js:\"server\"`\n\tBypass string `js:\"bypass\"`\n}\n\n// Validate validates the [ProxyOptions].\nfunc (p *ProxyOptions) Validate() error {\n\tif p == nil {\n\t\treturn nil\n\t}\n\tif strings.TrimSpace(p.Server) == \"\" {\n\t\treturn fmt.Errorf(\"proxy.server must be set\")\n\t}\n\treturn nil\n}\n\n// Validate validates the [Geolocation].\nfunc (g *Geolocation) Validate() error {\n\tif g.Longitude < -180 || g.Longitude > 180 {\n\t\treturn fmt.Errorf(`invalid longitude \"%.2f\": precondition -180 <= LONGITUDE <= 180 failed`, g.Longitude)\n\t}\n\tif g.Latitude < -90 || g.Latitude > 90 {\n\t\treturn fmt.Errorf(`invalid latitude \"%.2f\": precondition -90 <= LATITUDE <= 90 failed`, g.Latitude)\n\t}\n\tif g.Accuracy < 0 {\n\t\treturn fmt.Errorf(`invalid accuracy \"%.2f\": precondition 0 <= ACCURACY failed`, g.Accuracy)\n\t}\n\treturn nil\n}\n\n// GrantPermissionsOptions is used by BrowserContext.GrantPermissions.\ntype GrantPermissionsOptions struct {\n\tOrigin string\n}\n","sourceCodeStart":58,"sourceCodeEnd":91,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/common/browser_context_options.go#L58-L91","documentation":"Geolocation.Validate rejected the geolocation options passed to browser.newContext(): longitude is outside [-180, 180]. The invalid value is echoed with two decimals; the precondition mirrors Chrome DevTools Protocol constraints.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/browser_context_options.go:76 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a longitude in [-180, 180], e.g. geolocation: {longitude: 12.4924, latitude: 41.8902, accuracy: 100}","Swap latitude/longitude if values look transposed"],"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"}