Alfred-Skyblue / vue-draggable-plus

Universal Drag-and-Drop Component Supporting both Vue 3 and Vue 2
https://vue-draggable-plus.pages.dev/en/
MIT License
2.72k stars 106 forks source link

useDraggable.d.ts:1:25 - error TS1005: ',' expected. #58

Open xiandanchaorenguagua opened 7 months ago

xiandanchaorenguagua commented 7 months ago

PS F:\demo> npm run build

demo@0.0.1 build F:\demo vue-tsc --noEmit && vite build

node_modules/vue-draggable-plus/dist/useDraggable.d.ts:1:25 - error TS1005: ',' expected.

1 import Sortable, { type Options, type SortableEvent } from 'sortablejs';


node_modules/vue-draggable-plus/dist/useDraggable.d.ts:1:39 - error TS1005: ',' expected.

1 import Sortable, { type Options, type SortableEvent } from 'sortablejs';

Found 2 errors.

npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! demo@0.0.1 build: vue-tsc --noEmit && vite build npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the demo@0.0.1 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

chouchouji commented 7 months ago

Can you provide the current version of vue-draggable-plus ?

QBL2333 commented 6 months ago

版本0.3.2遇到同样的问题,pnpm -r build时报错 ../nodemodules/.pnpm/vue-draggable-plus@0.3.2@types+sortablejs@1.15.7/node_modules/vue-draggable-plus/dist/useDraggable.d.ts(1,25): error TS1005: ',' expected. ../nodemodules/.pnpm/vue-draggable-plus@0.3.2@types+sortablejs@1.15.7/node_modules/vue-draggable-plus/dist/useDraggable.d.ts(1,39): error TS1005: ',' expected.

chouchouji commented 6 months ago

版本0.3.2遇到同样的问题,pnpm -r build时报错 ../nodemodules/.pnpm/vue-draggable-plus@[0.3.2@types](mailto:0.3.2_@types)+sortablejs@1.15.7/node_modules/vue-draggable-plus/dist/useDraggable.d.ts(1,25): error TS1005: ',' expected. ../nodemodules/.pnpm/vue-draggable-plus@[0.3.2@types](mailto:0.3.2_@types)+sortablejs@1.15.7/node_modules/vue-draggable-plus/dist/useDraggable.d.ts(1,39): error TS1005: ',' expected.

我今天晚上会看下这个问题

chouchouji commented 6 months ago

版本0.3.2遇到同样的问题,pnpm -r build时报错 ../nodemodules/.pnpm/vue-draggable-plus@[0.3.2@types](mailto:0.3.2_@types)+sortablejs@1.15.7/node_modules/vue-draggable-plus/dist/useDraggable.d.ts(1,25): error TS1005: ',' expected. ../nodemodules/.pnpm/vue-draggable-plus@[0.3.2@types](mailto:0.3.2_@types)+sortablejs@1.15.7/node_modules/vue-draggable-plus/dist/useDraggable.d.ts(1,39): error TS1005: ',' expected.

能提供一下可以复现的代码或者仓库吗?我这里新创建了一个项目,例子是官网的hook示例,打包没有报错 image

QBL2333 commented 6 months ago

感谢debug,代码不太方便共享,既然不是普遍问题我之后再自己试试🤔

QBL2333 commented 6 months ago

补充:应该是typescript版本的问题,出现报错的repo使用的typescript版本是4.4.4,不支持import type语法所以报错了