Uniswap / sdk-core

⚙️ Code shared across TypeScript Uniswap SDK versions
MIT License
121 stars 354 forks source link

Error in Uniswap/sdk-core@3.2.4: Uncaught TypeError when assigning to read-only property '10' #62

Closed nsafari closed 1 year ago

nsafari commented 1 year ago

Description: I encountered an error when upgrading from version 3.2.2 to version 3.2.4 of the Uniswap/sdk-core library. The error occurs while trying to assign a value to a read-only property '10' in the string '0x1F98431c8aD98523631AE4a59f267346ea31F984'. Upon investigating, it appears that the issue originates from the following line of code:

var V3_CORE_FACTORY_ADDRESSES = _extends({}, SUPPORTED_CHAINS.reduce(function(memo, chainId) { return memo[chainId] = CHAIN_TO_ADDRESSES_MAP[chainId].v3CoreFactoryAddress; }, {}));

Expected Behavior: After upgrading to version 3.2.4, the code should execute without any errors, and the assignment to the read-only property should not occur.

Actual Behavior: When executing the code with version 3.2.4, an Uncaught TypeError is thrown, indicating that it is not possible to assign a value to a read-only property '10' in the string '0x1F98431c8aD98523631AE4a59f267346ea31F984'.

Root Cause: The error occurs in the reduce function during the second round, where the memo variable becomes a string. Attempting to define a property on a string is not allowed, causing the error.

cbachmeier commented 1 year ago

Should be resolved by #61 which has been merged into version 3.2.5

Menniti commented 1 year ago

Hello guys, I`m having the same issue!

Do you know how much time it takes to take effect on NPM ? I`m running this version using npm, but it does not find the version 3.2.5 thankss

cbachmeier commented 1 year ago

Hello guys, I`m having the same issue!

Do you know how much time it takes to take effect on NPM ? I`m running this version using npm, but it does not find the version 3.2.5 thankss

@Menniti 3.2.5 ended up having a build issue and has been deprecated. 3.2.6 corrects this and can be found here https://www.npmjs.com/package/@uniswap/sdk-core/v/3.2.6