{"record":{"id":"389a1ae1920cf6e4","repo":"ankane/pghero","slug":"nouislider-name-is-required","errorCode":null,"errorMessage":"noUiSlider: '{name}' is required.","messagePattern":"noUiSlider: '(.+?)' is required\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"app/assets/javascripts/pghero/nouislider.js","lineNumber":879,"sourceCode":"            keyboardSupport: true,\n            cssPrefix: \"noUi-\",\n            cssClasses: cssClasses,\n            keyboardPageMultiplier: 5,\n            keyboardMultiplier: 1,\n            keyboardDefaultStep: 10,\n        };\n        // AriaFormat defaults to regular format, if any.\n        if (options.format && !options.ariaFormat) {\n            options.ariaFormat = options.format;\n        }\n        // Run all options through a testing mechanism to ensure correct\n        // input. It should be noted that options might get modified to\n        // be handled properly. E.g. wrapping integers in arrays.\n        Object.keys(tests).forEach(function (name) {\n            // If the option isn't set, but it is required, throw an error.\n            if (!isSet(options[name]) && defaults[name] === undefined) {\n                if (tests[name].r) {\n                    throw new Error(\"noUiSlider: '\" + name + \"' is required.\");\n                }\n                return;\n            }\n            tests[name].t(parsed, !isSet(options[name]) ? defaults[name] : options[name]);\n        });\n        // Forward pips options\n        parsed.pips = options.pips;\n        // All recent browsers accept unprefixed transform.\n        // We need -ms- for IE9 and -webkit- for older Android;\n        // Assume use of -webkit- if unprefixed and -ms- are not supported.\n        // https://caniuse.com/#feat=transforms2d\n        var d = document.createElement(\"div\");\n        var msPrefix = d.style.msTransform !== undefined;\n        var noPrefix = d.style.transform !== undefined;\n        parsed.transformRule = noPrefix ? \"transform\" : msPrefix ? \"msTransform\" : \"webkitTransform\";\n        // Pips don't move, so we can place them using left/top.\n        var styles = [\n            [\"left\", \"top\"],","sourceCodeStart":861,"sourceCodeEnd":897,"githubUrl":"https://github.com/ankane/pghero/blob/7edb57986ffd36f9d64f0830c4ccc90a5eac46d6/app/assets/javascripts/pghero/nouislider.js#L861-L897","documentation":"During create(), noUiSlider runs every option through a test suite; options flagged as required (tests[name].r, notably start) must be present. isSet(options[name]) is false and no default exists, so the loop throws \"noUiSlider: '{name}' is required.\" with the option name interpolated. In practice the name is almost always 'start' - the initial handle value(s).","triggerScenarios":"noUiSlider.create(el, {}) with no start, or create(el, {range: {min: 0, max: 100}}) where only range was supplied. Also happens when options come from a variable that is undefined or built by a function that conditionally omits start.","commonSituations":"Slider configuration assembled from dynamic data (user settings, JSON) where start is omitted; refactoring that renames or drops the start key; upgrading from very old noUiSlider versions where option names differed. PgHero's own dashboard always passes start, so this only bites custom code using the vendored library.","solutions":["Add start: [value] (array) or start: value to the options, e.g. noUiSlider.create(el, {start: [50], range: {min: 0, max: 100}})","If options are dynamic, default the key before calling create: options.start = options.start || [0]","Check the noUiSlider documentation for the current required set (start and range are the two mandatory options)"],"exampleFix":"// before\nnoUiSlider.create(el, { range: { min: 0, max: 100 } });\n\n// after\nnoUiSlider.create(el, { start: [50], range: { min: 0, max: 100 } });","handlingStrategy":"validation","validationCode":"if (!Array.isArray(options.start) && !Number.isFinite(options.start)) {\n  throw new TypeError(\"slider options must include start\");\n}\nnoUiSlider.create(el, options);","typeGuard":"function isSliderOptions(o) {\n  return !!o && (Array.isArray(o.start) ? o.start.length > 0 : Number.isFinite(o.start)) && !!o.range;\n}","tryCatchPattern":null,"preventionTips":["Always write start and range together when composing slider options","Default dynamic options before create: options.start ||= [0]"],"tags":["nouislider","missing-option","javascript","validation"],"backgroundTag":"missing-required-option","analyzedSha":"7edb57986ffd36f9d64f0830c4ccc90a5eac46d6","analyzedAt":"2026-08-21T17:33:54.942Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}