ton-connect / sdk

SDK for TON Connect 2.0 — a comprehensive communication protocol between wallets and apps in TON ecosystem
Apache License 2.0
333 stars 98 forks source link

[SDK, UI]: TypeError: Cannot read properties of undefined (reading 'slice') #60

Closed arterialist closed 1 year ago

arterialist commented 1 year ago

**Describe the bug*** When having both @tonconnect/sdk and @tonconnect/ui[-react] in package.json, this exception is thrown if the user doesn't visit the dapp for a couple of days.

Steps to reproduce

  1. Add sdk and ui packages to package.json and implement Ton Connect in your dapp
  2. Visit the dapp and connect the walet
  3. Close dapp and don't open it for several days
  4. Open the dapp, the error will appear

Expected behavior It's expected for Ton Connect to work properly without throwing such exception

siandreev commented 1 year ago

This might happen if you installed both of @tonconnect/sdk and @tonconnect/ui (or @tonconnect/ui-react) at the same time. It might lead to libraries versions conflicts. To solve the issue

  1. Remove @tonconnect/sdk from the package.json and leave only @tonconnect/ui (or @tonconnect/ui-react).
  2. Remove node_modules and re-install dependencies
  3. Clear website localstorage

If you need @tonconnect/sdk functionality in your app, you can import all sdk entities directly from @tonconnect/ui