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

EventSource in (dom-monkeypatch.d.ts) is conflicting with EventSource in Typescript lib.dom.d.ts #914

Open
CITGuru opened this issue Jan 29, 2024 · 3 comments · May be fixed by #916
Open
Labels

Comments

@CITGuru
Copy link

CITGuru commented Jan 29, 2024

Describe the bug
EventSource in (dom-monkeypatch.d.ts) is conflicting with EventSource in Typescript lib.dom.d.ts

What version are you on?
Latest version - 11.2.1

To Reproduce
Steps to reproduce the behavior:

  1. Install Stellar SDK latest version
  2. upgrade typescript version to 5.3.3
  3. Try building the project and you get the error below:
node_modules/stellar-sdk/types/dom-monkeypatch.d.ts:34:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'CLOSED' must be of type '2', but here has type 'number'.

34   readonly CLOSED: number;
              ~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:8171:14
    8171     readonly CLOSED: 2;
                      ~~~~~~
    'CLOSED' was also declared here.

node_modules/stellar-sdk/types/dom-monkeypatch.d.ts:35:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'CONNECTING' must be of type '0', but here has type 'number'.

35   readonly CONNECTING: number;
              ~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:8169:14
    8169     readonly CONNECTING: 0;
                      ~~~~~~~~~~
    'CONNECTING' was also declared here.

node_modules/stellar-sdk/types/dom-monkeypatch.d.ts:36:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'OPEN' must be of type '1', but here has type 'number'.

36   readonly OPEN: number;
              ~~~~

  node_modules/typescript/lib/lib.dom.d.ts:8170:14
    8170     readonly OPEN: 1;
                      ~~~~
    'OPEN' was also declared here.


Found 3 errors in the same file, starting at: node_modules/stellar-sdk/types/dom-monkeypatch.d.ts:34

Additional context
I was able to fix this by deleting dom-monkeypatch.d.ts from the package and it worked fine without it

@CITGuru CITGuru added the bug label Jan 29, 2024
@CITGuru
Copy link
Author

CITGuru commented Jan 29, 2024

@Shaptic Can you help with this.

@CITGuru
Copy link
Author

CITGuru commented Jan 29, 2024

There are 2 fix to this:

  1. Delete dom-monkeypatch.d.ts

  2. Update the below variables from

    readonly CLOSED: number;
    readonly CONNECTING: number;
    readonly OPEN: number;
    

    to:

 readonly CLOSED: 2; 
 readonly CONNECTING: 0;
 readonly OPEN: 1; 

@CITGuru
Copy link
Author

CITGuru commented Jan 29, 2024

https://www.npmjs.com/package/@citguru/stellar-sdk If you are having the same issues. You can easily fix it by using this installation instead

@Shaptic Shaptic linked a pull request Jan 29, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant