{"record":{"id":"102a9ada65443a2a","repo":"Dogfalo/materialize","slug":"nouislider-missing-min-or-max-in-range","errorCode":null,"errorMessage":"noUiSlider: Missing 'min' or 'max' in 'range'.","messagePattern":"noUiSlider: Missing 'min' or 'max' in 'range'\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extras/noUiSlider/nouislider.js","lineNumber":483,"sourceCode":"        if ( !isNumeric( entry ) ) {\n            throw new Error(\"noUiSlider: 'step' is not numeric.\");\n        }\n\n        // The step option can still be used to set stepping\n        // for linear sliders. Overwritten if set in 'range'.\n        parsed.singleStep = entry;\n    }\n\n    function testRange ( parsed, entry ) {\n\n        // Filter incorrect input.\n        if ( typeof entry !== 'object' || Array.isArray(entry) ) {\n            throw new Error(\"noUiSlider: 'range' is not an object.\");\n        }\n\n        // Catch missing start or end.\n        if ( entry.min === undefined || entry.max === undefined ) {\n            throw new Error(\"noUiSlider: Missing 'min' or 'max' in 'range'.\");\n        }\n\n        // Catch equal start or end.\n        if ( entry.min === entry.max ) {\n            throw new Error(\"noUiSlider: 'range' 'min' and 'max' cannot be equal.\");\n        }\n\n        parsed.spectrum = new Spectrum(entry, parsed.snap, parsed.dir, parsed.singleStep);\n    }\n\n    function testStart ( parsed, entry ) {\n\n        entry = asArray(entry);\n\n        // Validate input. Values aren't tested, as the public .val method\n        // will always provide a valid location.\n        if ( !Array.isArray( entry ) || !entry.length ) {\n            throw new Error(\"noUiSlider: 'start' option is incorrect.\");","sourceCodeStart":465,"sourceCodeEnd":501,"githubUrl":"https://github.com/Dogfalo/materialize/blob/824e78248b3de81e383445e76ffb04cc3264fe7d/extras/noUiSlider/nouislider.js#L465-L501","documentation":"Thrown by testRange after the object check passes but entry.min or entry.max is undefined. Both endpoints are mandatory: 'min' maps to the 0% position and 'max' to the 100% position of the slider scale. Without them the spectrum cannot be constructed.","triggerScenarios":"range: { min: 0 }, range: { max: 100 }, range: { '50%': 50 } (no endpoints), or range: { min: 0, max: undefined }.","commonSituations":"Building range from partial data where one bound is missing, typoing a key (e.g. 'Max'), or a conditional spread that drops a key when a value is falsy.","solutions":["Always include both min and max.","Guard upstream: if (min == null || max == null) throw new Error('bounds required').","Fall back to sane defaults before constructing the slider."],"exampleFix":"// before\nrange: { min: 0 }\n// after\nrange: { min: 0, max: 100 }","handlingStrategy":"validation","validationCode":"if (opts.range.min == null || opts.range.max == null) {\n  throw new Error(\"range must define both 'min' and 'max'\");\n}","typeGuard":"function hasMinMax(r) { return r != null && r.min != null && r.max != null; }","tryCatchPattern":"try { noUiSlider.create(el, opts); }\ncatch (e) { if (/Missing 'min' or 'max'/.test(e.message)) { /* supply the missing bound */ } else throw e; }","preventionTips":["Treat min and max as required fields in your config type.","Guard the data source: refuse to render the slider until both bounds are known.","Beware conditional spreads that drop a key when its value is falsy."],"tags":["config","validation","range"],"backgroundTag":null,"analyzedSha":"824e78248b3de81e383445e76ffb04cc3264fe7d","analyzedAt":"2026-08-13T04:14:22.506Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}