sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Fix-import-for-check-balance-for-parcel-bundler

Open Harman-singh-waraich opened this issue 10 months ago • 1 comments

Similar to #182

I brought up the previous issue(#182) in lifi-discord, the issue was fixed with getTokenBalance but a similar issue remained with execute function.

Description :

  • Importing checkBalance from "./balance" causes error while Swapping in the widget or using execute in sdk , when building with parcel, Scope hoisting introduces errors where an export is undefined.

More info here : https://github.com/parcel-bundler/parcel/issues/6071

Screenshot 2024-04-18 at 11 14 28 PM Changes:
  • Changed the import of checkBalance function and directly imported it from ./balance/checkBalance , swapping now works perfectly
  • Updated the unit test with the new import changes

Tested out the changes by using the library locally and Swapping works fine with these changes

Harman-singh-waraich avatar Apr 18 '24 16:04 Harman-singh-waraich

@Harman-singh-waraich Hey, have you tried v3 to see if the issue is present there?

chybisov avatar Jul 19 '24 10:07 chybisov

@Harman-singh-waraich Hey, have you tried v3 to see if the issue is present there?

Hey, haven't had the chance to use v3 yet, as for the issue , we were facing it with parcel. Since then we have migrated to Vite and haven't seen the issue. Will update to v3 to see if there's any issue, will keep you updated.

Harman-singh-waraich avatar Jul 21 '24 12:07 Harman-singh-waraich

Great! Feel free to add to this discussion or open a new one if you have any issue :)

chybisov avatar Jul 22 '24 08:07 chybisov