question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript: Added types in 2.24.0 causing issues

See original GitHub issue

Since 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
rijkvanzantencommented, Jul 23, 2020

@Keimeno This one doesn’t cause any issues on my end 🙂 🎉

1reaction
David-Desmaisonscommented, Aug 20, 2020

@Keimeno PR merged and release updated: check version 2.24.1

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found