{"record":{"id":"12ed111138dcdb75","repo":"discourse/discourse","slug":"between-rule-expects-min-max-eg-between-1-10","errorCode":null,"errorMessage":"`between` rule expects min/max, eg: between:1,10","messagePattern":"`between` rule expects min/max, eg: between:1,10","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/discourse/app/form-kit/lib/validation-parser.js","lineNumber":57,"sourceCode":"\n  requiredRule(args = \"\") {\n    const [option] = args.split(\",\");\n    return {\n      trim: option === \"trim\",\n    };\n  }\n\n  startsWithRule(prefix) {\n    return { prefix };\n  }\n\n  endsWithRule(suffix) {\n    return { suffix };\n  }\n\n  betweenRule(args) {\n    if (!args) {\n      throw new Error(\"`between` rule expects min/max, eg: between:1,10\");\n    }\n\n    const [min, max] = args.split(\",\").map(Number);\n\n    return {\n      min,\n      max,\n    };\n  }\n\n  lengthRule(args) {\n    if (!args) {\n      throw new Error(\"`length` rule expects min/max, eg: length:1,10\");\n    }\n\n    const [min, max] = args.split(\",\").map(Number);\n\n    return {","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/discourse/discourse/blob/1b2d7253e854205d2c95c80b2c6a1cdd42e45059/frontend/discourse/app/form-kit/lib/validation-parser.js#L39-L75","documentation":"A rule-argument guard in FormKit's validation parser: the `between` rule was declared with an empty args string, so no min/max pair can be parsed. The faulty input is a validation declaration like `between:` with no `min,max` value.","triggerScenarios":"Thrown at frontend/discourse/app/form-kit/lib/validation-parser.js:57 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide min/max arguments, e.g. `between:1,10`","Check the validation string in the @validation attribute for a missing value after the colon","Ensure dynamic rule strings are built with arguments included"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1b2d7253e854205d2c95c80b2c6a1cdd42e45059","analyzedAt":"2026-08-26T03:11:08.302Z","contentChangedAt":"2026-08-26T03:11:08.302Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}