bcakmakoglu/vue-flow

๐Ÿ› [BUG]: some event Types are missing (nodeClick, nodeDoubleClick, ...)

delphi-sucks opened this issue ยท 8 comments

Is there an existing issue for this?

  • I have searched the existing issues and this is a new bug.

Current Behavior

The published build seems to be missing some event type definitions for Typescript.

The events for @node-click, @node-double-click, @node-context-menu, @nodes-change, ... still work like expected, but the types are missing in VueFlow.vue.d.ts.

The edge-Emits on the other hand work like expected.

Expected Behavior

The emit types for the mentioned emits should appear within the released build.

Steps To Reproduce

  1. Create a new Vue-Project with @vue-flow/core
  2. Implement vue-flow like in the described in the Quickstart
  3. Implement @node-click
    => Typescript doesn't know the event

Relevant log output

No response

Anything else?

With v1.23.0 it still worked and since v1.24.0 the problem exists.

The FlowEmits type within vue-flow's source seems to be correct, but for some reason some events get missing within the type-defintion file VueFlow.vue.d.ts.

Thanks for the report.
Seems like this was introduced with an internal update to Vue 3.3 and vue-tsc 1.8.x, which for some reason produce incorrect definition files.
The edge events seem to overwrite the node events, for whatever reason that is beyond me.

Though there is a solution for this and it will be released with the next patch (1.33.3).

Fixed with 1.33.3

Mh... seems like this introduced different warnings now ๐Ÿคฃ
I'll reopen this issue to keep track

Changing the order of the events in the interface actually solved the issue...
Very strange, I'll note that down and keep an eye on it but the issue should be resolved with 1.33.4.

@bcakmakoglu I just updated to the latest release (1.33.4) and the events nodeClick and most others, seem to work now, but there are still other events missing.

In my case:

  • onConnect
  • onNodesChange

Seems like Vue is behaving here quite weird in generating the type definition? O.o

Ugh... really?
Yeah it seems to behave like an idiot for some reason and it's super bothersome to check if every event is correctly defined one by one since there's a lot of them โ˜น๏ธ

I'll see if there's more moving around I can do that'll fix it or ask someone in the Vue Discord what the hell is up with this issue.

Will re-open this issue again until this is properly sorted out ๐Ÿฅฒ

Just rechecked on this issue and updated my package of @vue-flow/core from 1.23.0 to 1.37.1 and it seems to work now.

Couldn't find any missing events, so it probably got fixed by a vite update?

@delphi-sucks might be ๐Ÿ˜…
I haven't investigated this recently since I'm focusing more on getting prepared for v2