{"record":{"id":"fa50168d8dfbe00f","repo":"grafana/k6","slug":"invalid-compatibility-mode-s-use-s","errorCode":null,"errorMessage":"invalid compatibility mode \"%s\". Use: \"%s\"","messagePattern":"invalid compatibility mode \"(.+?)\"\\. Use: \"(.+?)\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/runtime_options.go","lineNumber":62,"sourceCode":"\tSummaryExport null.String `json:\"summaryExport\"`\n\tKeyWriter     null.String `json:\"-\"`\n\tTracesOutput  null.String `json:\"tracesOutput\"`\n\n\t// Until v2\n\tNewMachineReadableSummary null.Bool `json:\"newMachineReadableSummary\"`\n}\n\n// ValidateCompatibilityMode checks if the provided val is a valid compatibility mode\nfunc ValidateCompatibilityMode(val string) (cm CompatibilityMode, err error) {\n\tif val == \"\" {\n\t\treturn CompatibilityModeExtended, nil\n\t}\n\tif cm, err = CompatibilityModeString(val); err != nil {\n\t\tvar compatValues []string\n\t\tfor _, v := range CompatibilityModeValues() {\n\t\t\tcompatValues = append(compatValues, v.String())\n\t\t}\n\t\terr = fmt.Errorf(`invalid compatibility mode \"%s\". Use: \"%s\"`,\n\t\t\tval, strings.Join(compatValues, `\", \"`))\n\t}\n\treturn cm, err\n}\n","sourceCodeStart":44,"sourceCodeEnd":67,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/lib/runtime_options.go#L44-L67","documentation":"Raised by ValidateCompatibilityMode when the K6_COMPATIBILITY_MODE value (or --compatibility-mode flag) is not one of the supported JavaScript compatibility modes. The message lists the valid values.","triggerScenarios":"Thrown at lib/runtime_options.go:62 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use one of: extended, base, default (unsafe-compat) — typically \"extended\" or \"base\"","Check for typos in the flag or environment variable"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}