{"record":{"id":"eaaaa0ae6ff07eb0","repo":"Dogfalo/materialize","slug":"nouislider-limit-option-must-be-numeric","errorCode":null,"errorMessage":"noUiSlider: 'limit' option must be numeric.","messagePattern":"noUiSlider: 'limit' option must be numeric\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extras/noUiSlider/nouislider.js","lineNumber":614,"sourceCode":"            throw new Error(\"noUiSlider: 'margin' option must be numeric.\");\n        }\n\n        // Issue #582\n        if ( entry === 0 ) {\n            return;\n        }\n\n        parsed.margin = parsed.spectrum.getMargin(entry);\n\n        if ( !parsed.margin ) {\n            throw new Error(\"noUiSlider: 'margin' option is only supported on linear sliders.\");\n        }\n    }\n\n    function testLimit ( parsed, entry ) {\n\n        if ( !isNumeric(entry) ){\n            throw new Error(\"noUiSlider: 'limit' option must be numeric.\");\n        }\n\n        parsed.limit = parsed.spectrum.getMargin(entry);\n\n        if ( !parsed.limit || parsed.handles < 2 ) {\n            throw new Error(\"noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.\");\n        }\n    }\n\n    function testPadding ( parsed, entry ) {\n\n        if ( !isNumeric(entry) ){\n            throw new Error(\"noUiSlider: 'padding' option must be numeric.\");\n        }\n\n        if ( entry === 0 ) {\n            return;\n        }","sourceCodeStart":596,"sourceCodeEnd":632,"githubUrl":"https://github.com/Dogfalo/materialize/blob/824e78248b3de81e383445e76ffb04cc3264fe7d/extras/noUiSlider/nouislider.js#L596-L632","documentation":"Thrown by testLimit when 'limit' fails isNumeric. limit caps the maximum distance between handles and must be a real finite number; strings, null, and symbolic values are rejected by isNumeric.","triggerScenarios":"limit: '50', limit: null, limit: 'max', limit: NaN.","commonSituations":"String from DOM/JSON, null used as a 'disabled' marker, or a symbolic placeholder that was never converted.","solutions":["Pass a number: limit: 50.","Coerce with Number(raw) after an isFinite check.","Omit limit to disable the cap."],"exampleFix":"// before\nlimit: \"50\"\n// after\nlimit: 50","handlingStrategy":"validation","validationCode":"if (opts.limit != null) {\n  const l = Number(opts.limit);\n  if (typeof opts.limit !== 'number' || !Number.isFinite(l)) throw new TypeError('limit must be a number');\n  opts.limit = l;\n}","typeGuard":"function isLimit(v) { return typeof v === 'number' && Number.isFinite(v); }","tryCatchPattern":"try { noUiSlider.create(el, opts); }\ncatch (e) { if (/limit' option must be numeric/.test(e.message)) { opts.limit = Number(opts.limit); /* retry */ } else throw e; }","preventionTips":["Coerce string sources with Number() before assignment.","Omit limit rather than passing null/undefined explicitly.","Type limit as number | undefined in your config interface."],"tags":["config","validation","limit","type-coercion"],"backgroundTag":null,"analyzedSha":"824e78248b3de81e383445e76ffb04cc3264fe7d","analyzedAt":"2026-08-13T04:14:22.506Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}