{"record":{"id":"482c68439be6ffdd","repo":"OrchardCMS/OrchardCore","slug":"invalid-attempt-to-spread-non-iterable-instance-in-order-to-482c68","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.umd.js","lineNumber":1906,"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":1888,"sourceCodeEnd":1924,"githubUrl":"https://github.com/OrchardCMS/OrchardCore/blob/4306c0717fe573f6fca1b4955909ddab6a192807/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Vendor/vue-draggable-2.24.3/vuedraggable.umd.js#L1888-L1924","documentation":"vuedraggable's internal _toConsumableArray helper calls _iterableToArray, which returns undefined when the spread target lacks a [Symbol.iterator] method, so _nonIterableSpread() throws this TypeError. It means vuedraggable tried to spread a value that is neither an array nor an iterable (e.g. null, undefined, or a plain object).","triggerScenarios":"Binding v-model or the 'list' prop of <draggable> to a non-array value (object, null, undefined) or spreading a non-iterable inside a draggable slot/template while dragging re-renders the list.","commonSituations":"Initializing the bound list asynchronously (undefined until data loads), accidentally passing an object like {items: [...]} instead of the array, or Vuex state not yet populated.","solutions":["Initialize the v-model/list binding with an empty array [] instead of null/undefined","Guard rendering with v-if until the list data is loaded","Pass the array itself (items), not a wrapper object, to v-model/list","Check computed properties feeding the list — they must always return an array"],"exampleFix":"// before\n<draggable v-model=\"items\"> ...\n// items may be null\n// after\n<draggable v-model=\"items || []\"> ... or v-if=\"Array.isArray(items)\" wrapper","handlingStrategy":"type-guard","validationCode":"if (!Array.isArray(items)) { items = []; }","typeGuard":"function isIterable(v){ return v != null && typeof v[Symbol.iterator] === 'function'; }","tryCatchPattern":"try { renderDraggable(items); } catch (e) { if (e instanceof TypeError && e.message.includes('non-iterable')) { items = []; retryRender(); } }","preventionTips":["Always initialize list-bound state to []","Use v-if until async data arrives","Never bind objects/null to draggable v-model"],"tags":["vue","javascript","non-iterable","spread"],"backgroundTag":"type-mismatch","analyzedSha":"4306c0717fe573f6fca1b4955909ddab6a192807","analyzedAt":"2026-09-13T17:41:05.024Z","contentChangedAt":"2026-09-13T17:41:05.024Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}