Uniswap / v3-sdk

🛠 An SDK for building applications on top of Uniswap V3
MIT License
555 stars 429 forks source link

Upgrade regenerator-runtime #109

Open Jack-Works opened 2 years ago

Jack-Works commented 2 years ago

Hi! I found the built version of this project contains an old version of regenerator-runtime (https://github.com/facebook/regenerator/) which throws an error in our environment.

image

Please upgrade to the latest version of regenerator runtime, thanks!

The new code in the regenerator runtime:

image

marktoda commented 2 years ago

Hey @Jack-Works - thanks for reporting this! I've marked it down as an enhancement; we'd take a look if you wanted to submit a PR upgrading it!

hiroshitashir commented 1 year ago

It looks like package regenerator-runtime is installed via package tsdx. Both regenerator-runtime@0.13.11 and tsdx@0.14.1 are latest versions. I wonder if I'm missing something..

 % npm ls regenerator-runtime
@uniswap/sdk-core@3.2.6 /Users/hirotashiro/Uniswap/sdk-core
└─┬ tsdx@0.14.1
  ├─┬ babel-plugin-macros@2.8.0
  │ └─┬ @babel/runtime@7.22.5
  │   └── regenerator-runtime@0.13.11 deduped
  └── regenerator-runtime@0.13.11

% cd ../v3-sdk
% npm ls regenerator-runtime
@uniswap/v3-sdk@3.9.0 /Users/hirotashiro/Uniswap/v3-sdk
└─┬ tsdx@0.14.1
  ├─┬ babel-plugin-macros@2.8.0
  │ └─┬ @babel/runtime@7.22.5
  │   └── regenerator-runtime@0.13.11 deduped
  └── regenerator-runtime@0.13.11
Jack-Works commented 1 year ago

I took a look, and it is still using the old version. (New version should use define, not =). Maybe there is something wrong with the build step

image
hiroshitashir commented 1 year ago

node_modules/regenerator-runtime/runtime.js has the correct version in my environment.

Screenshot 2023-07-05 at 12 48 07 PM

It could be something to do with npm as you said. Deleting node_modules folder and running npm install might help? https://stackoverflow.com/questions/11351784/how-do-i-do-a-clean-install-delete-node-modules-and-install-with-npm

Jack-Works commented 1 year ago

Note: this is not related to the cache. The published version of @uniswap/v3-sdk has that code.

https://cdn.jsdelivr.net/npm/@uniswap/v3-sdk@3.9.0/dist/v3-sdk.esm.js

search gp[iteratorsymbol] and you can see it.

hiroshitashir commented 1 year ago

Good catch!