{"record":{"id":"ac2ca7ad72837d7e","repo":"Dogfalo/materialize","slug":"nouislider-animate-option-must-be-a-boolean","errorCode":null,"errorMessage":"noUiSlider: 'animate' option must be a boolean.","messagePattern":"noUiSlider: 'animate' option must be a boolean\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extras/noUiSlider/nouislider.js","lineNumber":528,"sourceCode":"    }\n\n    function testSnap ( parsed, entry ) {\n\n        // Enforce 100% stepping within subranges.\n        parsed.snap = entry;\n\n        if ( typeof entry !== 'boolean' ){\n            throw new Error(\"noUiSlider: 'snap' option must be a boolean.\");\n        }\n    }\n\n    function testAnimate ( parsed, entry ) {\n\n        // Enforce 100% stepping within subranges.\n        parsed.animate = entry;\n\n        if ( typeof entry !== 'boolean' ){\n            throw new Error(\"noUiSlider: 'animate' option must be a boolean.\");\n        }\n    }\n\n    function testAnimationDuration ( parsed, entry ) {\n\n        parsed.animationDuration = entry;\n\n        if ( typeof entry !== 'number' ){\n            throw new Error(\"noUiSlider: 'animationDuration' option must be a number.\");\n        }\n    }\n\n    function testConnect ( parsed, entry ) {\n\n        var connect = [false];\n        var i;\n\n        // Map legacy options","sourceCodeStart":510,"sourceCodeEnd":546,"githubUrl":"https://github.com/Dogfalo/materialize/blob/824e78248b3de81e383445e76ffb04cc3264fe7d/extras/noUiSlider/nouislider.js#L510-L546","documentation":"Thrown by testAnimate when 'animate' is not a boolean. animate controls whether handle movement is animated; like snap it requires a real boolean and rejects numeric/string stand-ins. The value is assigned first, so the throw is what actually stops init.","triggerScenarios":"animate: 1, animate: 0, animate: 'true', animate: 'false' (truthy string).","commonSituations":"String from DOM/JSON, a numeric flag from a settings object, or a framework binding that turns the attribute into a string.","solutions":["Use literal true or false.","Coerce: animate: Boolean(raw) when raw is genuinely boolean-ish.","Omit animate to use the default (true)."],"exampleFix":"// before\nanimate: cfg.animate       // cfg.animate === 'true'\n// after\nanimate: Boolean(cfg.animate)","handlingStrategy":"type-guard","validationCode":"if (opts.animate != null && typeof opts.animate !== 'boolean') {\n  throw new TypeError('animate must be a boolean');\n}","typeGuard":"function isBoolean(v) { return typeof v === 'boolean'; }","tryCatchPattern":"try { noUiSlider.create(el, opts); }\ncatch (e) { if (/animate' option must be a boolean/.test(e.message)) { opts.animate = Boolean(opts.animate); /* retry */ } else throw e; }","preventionTips":["Treat animate as a real boolean at the config boundary.","Beware 'false' strings, which are truthy and would also misbehave if accepted.","Omit the option to accept the default rather than passing undefined explicitly."],"tags":["config","validation","animate","boolean"],"backgroundTag":null,"analyzedSha":"824e78248b3de81e383445e76ffb04cc3264fe7d","analyzedAt":"2026-08-13T04:14:22.506Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}