ethers.js: Can't resolve './platform' compilation error in ethers v5 beta

I’m trying the v5 beta with a simple create-react-app + typescript and as soon as I start the project, I’m getting an error:

./node_modules/ethers/ethers.js
Module not found: Can't resolve './platform' in '/Users/wmitsuda/test-ethers/node_modules/ethers'

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 25 (10 by maintainers)

Most upvoted comments

Actually in ethers package.json there is this :

"browser": {
    "platform.js": "browser-platform.js"
  },

but since the require is require("./platform.js") I tried to replace with this:

"browser": {
    "./platform.js": "./browser-platform.js"
  },

and it works