decentraland / decentraland/decentraland-dapps

Optimized 'ethers' imports don't work on the Marketplace

Open
#360 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
116
Forks
52
Avg merge
18h 12m
Merged PRs (30d)
11

Description

Version [v13.31.3](https://github.com/decentraland/decentraland-dapps/releases/tag/v13.31.3) Includes a change to optimize ethers imports reducing the bundle size of importers considerably.

However, this change has brought some issues when being imported into the Marketplace.

One example is when the user attempts to sign-in the flow breaks with:

![image.png](https://images.zenhubusercontent.com/5ea09af31c23030cb8e249b8/70d5b8df-25af-432f-80c6-fa16bc4e93de)

Which is caused by https://github.com/decentraland/decentraland-dapps/blob/master/src/modules/wallet/utils/buildWallet.ts#L20

The issue is fixed by changing:

```
import { Web3Provider } from '@ethersproject/providers/lib/web3-provider';
...

export async function buildWallet(appChainId: ChainId): Promise {
...
const eth = new Web3Provider(provider);
```

into:

```
import { ethers } from 'ethers';
...

export async function buildWallet(appChainId: ChainId): Promise {
...
const eth = new ethers.providers.Web3Provider(provider);
```

With this the user can start signing up, however, balances cannot be fetched and transactions cannot be sent, meaning it covers a lot of other aspects of the application.

To prevent blocking the marketplace from using any dapps updates, the changes to ethers can be [reverted](https://github.com/decentraland/decentraland-dapps/pull/358) and re-evaluated on the future to work on all dapps.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.