vue.draggable.next icon indicating copy to clipboard operation
vue.draggable.next copied to clipboard

Error using vue3.2.32 + vite 2.9.4

Open muyi0728 opened this issue 2 years ago • 15 comments

企业微信截图_9f0d6be8-e024-44d8-86ca-f0d626918c3b

muyi0728 avatar Apr 14 '22 09:04 muyi0728

same here

Tnze avatar Apr 16 '22 13:04 Tnze

Made some tests. The issue is not vite. It works fine with [email protected] (latest as of the time of this writing) The problem is with [email protected] and higher

lhermann avatar Apr 16 '22 15:04 lhermann

Similiar here: Uncaught TypeError: Cannot set properties of null (setting '__draggable_context') at addContext2 (componentStructure.js:3:15) at componentStructure.js:33:7 at Array.forEach (<anonymous>) at ComponentStructure.updated (componentStructure.js:32:18) at Proxy.mounted (vuedraggable.js:125:24) at callWithErrorHandling (runtime-core.esm-bundler.js:155:22) at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:164:21) at Array.hook.__weh.hook.__weh (runtime-core.esm-bundler.js:2685:29) at flushPostFlushCbs (runtime-core.esm-bundler.js:356:32) at render2 (runtime-core.esm-bundler.js:5688:9) I did a test and it works again after I removed the tag="transition-group" Tested under "vue": "^3.2.33", "vite": "^2.9.5"

chobitsnerv avatar Apr 17 '22 10:04 chobitsnerv

https://github.com/vuejs/core/blob/main/CHANGELOG.md#3232-2022-04-12 [email protected]looks update "transition-group" which may casue some issues here, I have some warning msg as following from chrome. Hope it can help in some degree.

image @David-Desmaisons

chobitsnerv avatar Apr 17 '22 10:04 chobitsnerv

We are having the same issue after updating to vue 3.2.33.

sortingbubbles avatar Apr 19 '22 10:04 sortingbubbles

I having same issue after updating to vue 3.2.33

pungfen avatar Apr 20 '22 01:04 pungfen

In the temporary solution of vue3.2.33 version, remove the tag="transition-group" attribute, you can run the code normally

muyi0728 avatar Apr 20 '22 02:04 muyi0728

[email protected]

Uncaught (in promise) TypeError: Cannot set properties of null (setting '__draggable_context') remove the tag="transition-group" attribute, it's ok

ddmy avatar Apr 20 '22 07:04 ddmy

If you remove the transition-group attribute, then you are forced to use a vertical layout of draggable. What does transition group do under the hood that i could mimic without adding the attribute?

JokerMartini avatar Apr 25 '22 15:04 JokerMartini

Code like this

<draggable
      v-model="appItems"
      tag="transition-group"
      v-bind="dragOptions"
      item-key="uid"
    >
      <template #item="{ element }">
        <AppItemCard :item="element" :key="element.uid" />
      </template>
    </draggable>

Which previously worked, no longer works with the latest version of vue.

JokerMartini avatar Apr 25 '22 15:04 JokerMartini

if you downgrade your vue to vue 3.2.30 it will work

JokerMartini avatar Apr 25 '22 16:04 JokerMartini

if you downgrade your vue to vue 3.2.30 it will work

Have you solved it?

superchangme avatar Apr 26 '22 01:04 superchangme

it's none of business with vite, it's problem about vue's component transition-group ,it lost el dom property

superchangme avatar Apr 27 '22 09:04 superchangme

This is the same error as in this issue: https://github.com/SortableJS/vue.draggable.next/issues/140#issuecomment-1123622724=

There is a pull request with a fix that is also available as forked package: zhyswan-vuedraggable

dpschen avatar May 22 '22 17:05 dpschen

This is the same error as in this issue: #140 (comment)

There is a pull request with a fix that is also available as forked package: zhyswan-vuedraggable

This was able to fix it for me, thank you

jomanning avatar Jun 11 '22 23:06 jomanning