vue.draggable.next
vue.draggable.next copied to clipboard
TypeError: isFunction is not a function in vue3 esm environment
I have a vue3 project hat uses es-modules ("type" = "module" in package.json)
// package.json
{
// ...
"type": "module"
}
I tried to use vuedraggable in v4.1.0 inside a component:
<script setup lang="ts">
import vuedraggable from 'vuedraggable';
</script>
<template>
<div>Test</div>
</template>
After this import (even without using it afterwards) I get the following error:
I looked into the module export of vuedraggable and it seems that there is no real esm export. Instead it uses the umd export. Maybe this is the reasoon why this error occurs.
https://github.com/SortableJS/vue.draggable.next/issues/132
Same here, have you found any solution?
Same here, have you found any solution?
我也遇到了这个问题,在我的场景下,不是 vuedraggable 的问题。 isFunction
是 vue3 的 shared utils ,我们项目用了 autoimports ,比如 vue 的 createApp 就会 auto import. 我在 src/main.ts
最上面加上了
import { createApp } from 'vue';
就可以了,猜想可能是因为 autoImports 的存在导致 vuedraggable 加载的时候 vue 还没加载,所以报错如此。