Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version 18.8.4 , dom onclick event type error,18.8.3 is normal #62667

Open
FrontEndDog opened this issue Oct 12, 2022 · 7 comments
Open

version 18.8.4 , dom onclick event type error,18.8.3 is normal #62667

FrontEndDog opened this issue Oct 12, 2022 · 7 comments

Comments

@FrontEndDog
Copy link

FrontEndDog commented Oct 12, 2022

node version 14.19.3
typescript version 4.8.4
image
image

@daniluk4000
Copy link

Same error with most of DOM types

@heavenshell
Copy link
Contributor

heavenshell commented Oct 13, 2022

I've got below type errors when updated to v18.8.4.

TypeScript: 4.8.4
Node: v18.10.0, v16.17.0

tsc -p tsconfig.json --noEmit
node_modules/@storybook/api/dist/ts3.9/modules/shortcuts.d.ts:55:18 - error TS2430: Interface 'Event' incorrectly extends interface 'KeyboardEvent'.
  Types of property 'target' are incompatible.
    Property 'prototype' is missing in type '{ tagName: string; addEventListener(): void; removeEventListener(): boolean; dispatchEvent(event: Event): boolean; getAttribute(attr: string): string | null; }' but required in type 'EventTarget'.

55 export interface Event extends KeyboardEvent {
                    ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:5162:5
    5162     prototype: EventTarget;
             ~~~~~~~~~
    'prototype' is declared here.


Found 1 error in node_modules/@storybook/api/dist/ts3.9/modules/shortcuts.d.ts:55

@FrontEndDog
Copy link
Author

This may be a problem with vue,please see

vuejs/core#6855

@daniluk4000
Copy link

daniluk4000 commented Oct 14, 2022

@FrontEndDog I still use Vue 2.6.12. The only thing I updated is @types/node.

I've created a very simple reproduction of my problem without 3rd-party libs here: https://github.com/daniluk4000/types-node-error

@FrontEndDog
Copy link
Author

@FrontEndDog I still use Vue 2.6.12. The only thing I updated is @types/node.

I've created a very simple reproduction of my problem without 3rd-party libs here: https://github.com/daniluk4000/types-node-error

yes,I reappeared, This problem still exists with 18.8.5

@falsandtru
Copy link
Contributor

#62729 will fix them.

@kesupile
Copy link

Hello! I've also encountered a similar issue with DOM types. In my case the HTMLElement type is showing some strange/incorrect behaviour.

Version 18.8.3
image

Version 18.8.4
image

element should be () => HTML | null inside the type guard, but it is still MaybeFn. This problem is still present in the latest release (v18.11.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants