web3-react icon indicating copy to clipboard operation
web3-react copied to clipboard

Package @web-react/gnosis-safe does not bundle with Vite 4 in production

Open ascotto opened this issue 2 years ago • 0 comments

Hello, I am using the @web3-react/gnosis-safe package with which works with Vite in development, but in production mode there Vite can't relate/find to the packages libraries:

  • @safe-{}/safe-apps-provider
  • @safe-{}/safe-apps-sdk

The warning message from Vite in production:

  • "@safe-{}/safe-apps-provider" is imported by "@safe-{}/safe-apps-provider?commonjs-external", but could not be resolved – treating it as an external dependenc
  • "@safe-{}/safe-apps-sdk" is imported by "@safe-{}/safe-apps-sdk?commonjs-external", but could not be resolved – treating it as an external dependency.

The dapp in development mode runs without issues in productions the dapp does not work as it cannot find correctly the two packages.

Tried to use commonjs() plugin for Vite but no luck, do you have any suggestions?

ascotto avatar Apr 28 '23 11:04 ascotto