TypeScript: Added types in 2.24.0 causing issues
See original GitHub issueSince release v2.24.0, vuedraggable
includes typing information for the package. While this is generally super useful to have included out of the box, it’s causing a bit of a problem for me currently:
I’m getting an error from TypeScript originating in vuedraggable
when trying to compile my app after updating to v2.24.0
:
ERROR in /Users/rijk/[redacted]/node_modules/vuedraggable/src/vuedraggable.d.ts(8,5):
8:5 Property 'element' in type 'Draggable' is not assignable to the same property in base type 'object & Record<never, any> & Vue'.
Type 'string' is not assignable to type 'Element | null'.
6 | noTransitionOnDrag: boolean;
7 |
> 8 | element: string;
| ^
9 |
10 | tag: string;
11 |
Next to this, TypeScript keeps complaining that the Draggable class can’t be used in components
as Draggable
can’t be assigned to VueConstructor<Vue>
*:
No overload matches this call.
Overload 3 of 3, '(options: ComponentOptionsWithProps<{ collection: { type: StringConstructor; required: true; }; }, Data, Data, {}, {}, { collection: string; } & {}>): VueProxy<...>', gave the following error.
Type 'typeof Draggable' is not assignable to type 'VueConstructor<Vue> | FunctionalComponentOptions<any, PropsDefinition<any>> | ComponentOptions<never, any, any, any, any, Record<...>> | AsyncComponentPromise<...> | AsyncComponentFactory<...>'.
Type 'typeof Draggable' is not assignable to type 'VueConstructor<Vue>'.
* This is when using @vue/composition-api
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:18 (8 by maintainers)
Top Results From Across the Web
How to get rid of the warning .ts file is part of the TypeScript ...
Explicitly adding the 'files' array with the 2 entry files above, cleared the warnings.
Read more >Documentation - Everyday Types - TypeScript
In this chapter, we'll cover some of the most common types of values you'll find in JavaScript code, and explain the corresponding ways...
Read more >@typescript-eslint/eslint-plugin-tslint | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >loomSDK Changelog: Week of Jan 30, 2022
Revert from last release due to an issue. ... feature flag handling and some internal updates to the typescript compiler and config.
Read more >Release notes - OpenTok.js | Vonage Video API Developer
This release fixes some issues — see the list of fixed issues. New Features in OpenTok.js 2.24.0 — October 2022. Added support to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Keimeno This one doesn’t cause any issues on my end 🙂 🎉
@Keimeno PR merged and release updated: check version 2.24.1