{"record":{"id":"9e103a4298d4dd64","repo":"OrchardCMS/OrchardCore","slug":"invalid-attempt-to-spread-non-iterable-instance-in-order-to","errorCode":null,"errorMessage":"Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.","messagePattern":"Invalid attempt to spread 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.common.js","lineNumber":1897,"sourceCode":"}\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) {\n  if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js\nfunction _iterableToArray(iter) {\n  if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n}\n// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js\nfunction _nonIterableSpread() {\n  throw new TypeError(\"Invalid attempt to spread 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/toConsumableArray.js\n\n\n\n\nfunction _toConsumableArray(arr) {\n  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n// EXTERNAL MODULE: external {\"commonjs\":\"sortablejs\",\"commonjs2\":\"sortablejs\",\"amd\":\"sortablejs\",\"root\":\"Sortable\"}\nvar external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_ = __webpack_require__(\"a352\");\nvar external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_);\n\n// EXTERNAL MODULE: ./src/util/helper.js\nvar helper = __webpack_require__(\"c649\");\n\n// CONCATENATED MODULE: ./src/vuedraggable.js\n","sourceCodeStart":1879,"sourceCodeEnd":1915,"githubUrl":"https://github.com/OrchardCMS/OrchardCore/blob/4306c0717fe573f6fca1b4955909ddab6a192807/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Vendor/vue-draggable-2.24.3/vuedraggable.common.js#L1879-L1915","documentation":"This TypeError comes from Babel's _toConsumableArray/_iterableToArray helpers inside the vuedraggable bundle. vuedraggable (or code using it) tried to spread a value with '...' that is neither an array nor an iterable (no [Symbol.iterator] method). Typical root cause is passing null/undefined or a plain object where an array of list items is expected.","triggerScenarios":"Passing a non-array value to the draggable's 'list' or 'value' prop (e.g. null, undefined, or an object) so the component spreads it with toConsumableArray; spreading the result of cloneDeep/getValue when it returns a non-iterable.","commonSituations":"Initialising the bound list asynchronously and rendering <draggable> before data arrives; binding list to a Vuex/axios response object instead of an array; Vue 3/projects where vuedraggable 2.x internals receive proxy objects that lost iterability.","solutions":["Ensure the list/value prop is always an initialized array: list: [] instead of null","Guard rendering with v-if=\"Array.isArray(items)\" until data is loaded","Normalize incoming data with Array.from(value ?? []) before passing it to draggable","Upgrade to vuedraggable/SortableJS version matching your Vue major version (vue.draggable.next for Vue 3)"],"exampleFix":"// before\n<draggable :list=\"items\" ...>\n// items may be undefined while loading\n\n// after\n<draggable v-if=\"Array.isArray(items)\" :list=\"items\" ...>\n// or items = Array.from(apiResponse ?? [])","handlingStrategy":"type-guard","validationCode":"if (!Array.isArray(items)) { items = []; } // before passing :list=\"items\"","typeGuard":"function isList(v) { return Array.isArray(v) || (v && typeof v[Symbol.iterator] === 'function'); }","tryCatchPattern":"try { renderList(toConsumableArray(items)); } catch (e) { if (e instanceof TypeError && /non-iterable/.test(e.message)) { items = []; } else { throw e; } }","preventionTips":["Always initialize list props with []","v-if on Array.isArray before mounting draggable","Normalize API responses with Array.from/Array.isArray","Match vuedraggable version to your Vue major"],"tags":["vue","javascript","typeerror","iterable","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"}