react-sortablejs
react-sortablejs copied to clipboard
TS2304: Cannot find name 'Sortable'.
Getting these errors when trying to build my project
node_modules/react-sortablejs/dist/index.d.ts:27:40 - error TS2304: Cannot find name 'Sortable'.
27 setList: (newState: T[], sortable: Sortable | null, store: Store) => void;
~~~~~~~~
node_modules/react-sortablejs/dist/index.d.ts:61:104 - error TS2304: Cannot find name 'Sortable'.
61 export type ReactSortableOptions = Partial<Record<AllMethodsExceptMove, (evt: SortableEvent, sortable: Sortable | null, store: Store) => void>> & {
~~~~~~~~
node_modules/react-sortablejs/dist/index.d.ts:69:63 - error TS2304: Cannot find name 'Sortable'.
69 onMove?: (evt: MoveEvent, originalEvent: Event, sortable: Sortable | null, store: Store) => boolean | -1 | 1 | void;
yarn.lock
has these versions:
"@types/sortablejs@^1.10.6":
version "1.10.6"
react-sortablejs@^6.0.0:
version "6.0.0"
sortablejs@^1.10.6:
version "1.12.0"
Does setting skipLibCheck: false
or other skip*
settings fix this?
Using skipLibCheck
does allow it to run, but so does adding Sortable
to the import in dist/index.d.ts
, which is already importing other things from sortablejs
.
- import { MoveEvent, Options, SortableEvent } from "sortablejs";
+ import Sortable, { MoveEvent, Options, SortableEvent } from "sortablejs";
This seems preferable. How does that file get built?
At first glance, it looks like it should already be included here. ❓
That's what I found as well...not sure why that import doesn't end up in the compiled definitions file.
At first glance, it looks like it should already be included here. ❓
I wonder if this is the same underlying issue from Parcel: https://github.com/parcel-bundler/parcel/issues/4250
What was the reason for switching to Parcel for building this library? At least the Parcel-2 beta doesn't quite seem ready
Is that issue going to be resolved? It prevents me from publishing app, and I don't want to use skips
Use [email protected] to build can resolve this problem.