{"record":{"id":"0b6b611fa09fb031","repo":"OrchardCMS/OrchardCore","slug":"invalid-attempt-to-destructure-non-iterable-instance-in-0b6b61","errorCode":null,"errorMessage":"Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.","messagePattern":"Invalid attempt to destructure non-iterable instance\\.\nIn order to be iterable, non-array objects must have a \\[Symbol\\.iterator\\]\\(\\) method\\.","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Vendor/vue-draggable-2.24.3/vuedraggable.umd.js","lineNumber":1879,"sourceCode":"  for (var i = 0, arr2 = new Array(len); i < len; i++) {\n    arr2[i] = arr[i];\n  }\n\n  return arr2;\n}\n// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js\n\nfunction _unsupportedIterableToArray(o, minLen) {\n  if (!o) return;\n  if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n  var n = Object.prototype.toString.call(o).slice(8, -1);\n  if (n === \"Object\" && o.constructor) n = o.constructor.name;\n  if (n === \"Map\" || n === \"Set\") return Array.from(o);\n  if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js\nfunction _nonIterableRest() {\n  throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js\n\n\n\n\nfunction _slicedToArray(arr, i) {\n  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n}\n// EXTERNAL MODULE: ./node_modules/core-js/modules/es7.array.includes.js\nvar es7_array_includes = __webpack_require__(\"6762\");\n\n// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.string.includes.js\nvar es6_string_includes = __webpack_require__(\"2fdb\");\n\n// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js\n\nfunction _arrayWithoutHoles(arr) {","sourceCodeStart":1861,"sourceCodeEnd":1897,"githubUrl":"https://github.com/OrchardCMS/OrchardCore/blob/4306c0717fe573f6fca1b4955909ddab6a192807/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Vendor/vue-draggable-2.24.3/vuedraggable.umd.js#L1861-L1897","documentation":"This TypeError comes from Babel's _slicedToArray/_nonIterableRest helper in the vuedraggable UMD bundle. Destructuring with array pattern (const [a, b] = x) was applied to a value that is not iterable (null, undefined, or a plain object without [Symbol.iterator]). The library's compiled code destructures array-like results, so the input was not the expected array.","triggerScenarios":"Code inside the bundle (or its SortableJS dependency) destructuring a function result that returned null/undefined or an object instead of an array, e.g. parsing a value with a regex or splitting a value that isn't a string, then doing const [m1, m2] = result.","commonSituations":"Feeding undefined/null data into draggable options that get destructured internally; mismatched vuedraggable version vs Vue causing internal helpers to receive wrong shapes; corrupted vendored UMD bundle edited by hand.","solutions":["Ensure any values/options passed to draggable are complete, correctly-typed arrays/strings","Replace hand-edited vendored bundles with the pristine published vuedraggable 2.24.3 file","Check that data bound to the component is initialized before first render","Use the ESM build (vuedraggable.common.js / vue.draggable.next) appropriate for your Vue version"],"exampleFix":"// before\nconst [name, value] = maybeNull; // maybeNull is null -> TypeError\n\n// after\nconst [name, value] = Array.isArray(maybeNull) ? maybeNull : [];","handlingStrategy":"type-guard","validationCode":"if (!Array.isArray(result)) result = []; const [a, b] = result;","typeGuard":"function asArray(v) { return Array.isArray(v) ? v : (v && typeof v[Symbol.iterator] === 'function' ? Array.from(v) : []); }","tryCatchPattern":"try { const [x, y] = value; } catch (e) { if (e instanceof TypeError && /non-iterable/.test(e.message)) { value = []; } else { throw e; } }","preventionTips":["Initialize all data bound to draggable before render","Never hand-edit vendored bundles","Default-destructure: const [a = null, b = null] = value ?? []","Use the build matching your Vue/module system"],"tags":["vue","javascript","typeerror","iterable","destructuring","vuedraggable"],"backgroundTag":"type-mismatch","analyzedSha":"4306c0717fe573f6fca1b4955909ddab6a192807","analyzedAt":"2026-09-13T17:41:05.024Z","contentChangedAt":"2026-09-13T17:41:05.024Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}