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

Interface 'Event' incorrectly extends interface (Type 'boolean' is not assignable to type '() => void') #813

Open
bilal-baig-kryptomind opened this issue Apr 5, 2023 · 1 comment
Labels

Comments

@bilal-baig-kryptomind
Copy link

Describe the bug
There is an issue that is coming from node modules when creating build in nest js. Here is the path of the file from where the issue is coming from node_modules/stellar-sdk/types/dom-monkeypatch.d.ts:111:11 - error TS2430:

The descriptive Error message is:

node_modules/stellar-sdk/types/dom-monkeypatch.d.ts:111:11 - error TS2430: Interface 'Event' incorrectly extends interface '{ readonly bubbles: boolean; cancelBubble: () => void; readonly cancelable: boolean; readonly composed: boolean; composedPath(): [EventTarget?]; readonly currentTarget: EventTarget; ... 10 more ...; readonly type: string; }'.
Types of property 'cancelBubble' are incompatible.
Type 'boolean' is not assignable to type '() => void'.

111 interface Event {
~~~~~

Found 1 error(s).

What version are you on?
I tried with different version from 10.4.1 to downgrading to 10.1.2 and also same with version 9.

To Reproduce
Steps to reproduce the behavior:

  1. Setup stellar sdk in nest js
  2. Run yarn build or npm run build (build will create successfully though but will throw error that is mentioned above)

Expected behavior
It should not throw error while creating build.

@CITGuru
Copy link

CITGuru commented Jan 29, 2024

Any update on this, I am having this same issue and more:


6     onerror?: (event: MessageEvent) => void;
                        ~~~~~~~~~~~~

node_modules/stellar-sdk/types/dom-monkeypatch.d.ts:11:12 - error TS2304: Cannot find name 'MessageEvent'.

11   message: MessageEvent;
              ~~~~~~~~~~~~

node_modules/stellar-sdk/types/dom-monkeypatch.d.ts:17:39 - error TS2304: Cannot find name 'MessageEvent'.

17   onmessage: ((this: EventSource, ev: MessageEvent) => any) | null;
                                         ~~~~~~~~~~~~

node_modules/stellar-sdk/types/dom-monkeypatch.d.ts:111:11 - error TS2430: Interface 'Event' incorrectly extends interface '{ readonly bubbles: boolean; cancelBubble: () => void; readonly cancelable: boolean; readonly composed: boolean; composedPath(): [(EventTarget | undefined)?]; readonly currentTarget: EventTarget | null; ... 10 more ...; readonly type: string; }'.
  The types returned by 'composedPath()' are incompatible between these types.
    Type 'EventTarget[]' is not assignable to type '[(EventTarget | undefined)?]'.
      Target allows only 1 element(s) but source may have more.

111 interface Event {
              ~~~~~


Found 4 errors in 2 files.

Errors  Files
     1  node_modules/stellar-sdk/lib/horizon/call_builder.d.ts:6
     3  node_modules/stellar-sdk/types/dom-monkeypatch.d.ts:11```

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

No branches or pull requests

3 participants
@CITGuru @bilal-baig-kryptomind and others