etherspot / etherspot-prime-sdk

Etherspot Prime - Account Abstraction SDK
https://etherspot.fyi
MIT License
129 stars 22 forks source link

few package issues #64

Closed Shivamycodee closed 1 year ago

Shivamycodee commented 1 year ago

whenever i have installed this package: @etherspot/prime-sdk and tried to use it i got a same error that few required packages of prime-sdk were missing:

1.rxjs

  1. reflect-metadata

it works fine when i install this 2 packages to my app package.json.

and 1 more issue , in your file node-polyfill.js (node_modules@etherspot\prime-sdk\dist\node-polyfill.js)

websocket is considered as an part of global object, and i was getting error because my browsers (chrome and barve) were not able to understand what global is , so i changed it to windows ,

from : global.WebSocket = WebSocketConstructor; to : window.WebSocket = WebSocketConstructor;

and then installed my updated package, after this it's working fine.

ch4r10t33r commented 1 year ago

@Shivamycodee Can you pls report the version number of the SDK you are using?

Shivamycodee commented 1 year ago

@etherspot/prime-sdk : 1.3.8

ch4r10t33r commented 1 year ago

@etherspot/prime-sdk : 1.3.8

Thanks. Please can you let us know OS details and do you have an example repository where we can reproduce this error?

Shivamycodee commented 1 year ago

Device specification:

Device name LAPTOP-T8QTOCJJ Processor Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz 1.19 GHz Installed RAM 20.0 GB (19.7 GB usable) Device ID .... Product ID ... System type 64-bit operating system, x64-based processor

windows specification:

Edition Windows 11 Home Insider Preview Single Language Version 23H2 Installed on ‎10/‎26/‎2023 OS build ... Serial number ... Experience Windows Feature Experience Pack 1000.25982.1000.0

package errors:

https://cdn.discordapp.com/attachments/1168437799528181770/1168837543274483802/image.png?ex=655337ca&is=6540c2ca&hm=9f61811cf1c685a2629cf98ac4a7e8e6cae47dc4bf1a8d1ff4b45522e4381ea5&

image

Shivamycodee commented 1 year ago

I saw u have updated the global code to:

(global as any).WebSocket = WebSocketConstructor;

but it still not working (installed it using : npm i @etherspot/prime-sdk@latest) , it's only working when i use window in place of global.

so i think something like this should be used:

if(global)
   global.WebSocket = WebSocketConstructor;
else
  window.WebSocket = WebSocketConstructor