SyntaxError: Cannot declare a let variable twice: 'n'.
Expected behavior
Should be able to build a production release and have the resulting app not throw the error.
Additional context
I checked out the @hashgraph/hedera-wallet-connect repo and turned off the esbuild minification feature. I then built the package and imported that dependency directly into the project. This worked fine without any SyntaxErrors. As soon as I turn on minification, the problem occurs again.
Describe the bug
The package appears to be clashing with the global namespace…
To Reproduce
Checkout this minimal repository which is a vanilla NextJS app with the HWC package imported dynamically in a client component:
https://github.com/justynspooner/hedera-wallet-connect-test/tree/main
Check the console logs in the browser:
Expected behavior
Should be able to build a production release and have the resulting app not throw the error.
Additional context
I checked out the @hashgraph/hedera-wallet-connect repo and turned off the esbuild minification feature. I then built the package and imported that dependency directly into the project. This worked fine without any SyntaxErrors. As soon as I turn on minification, the problem occurs again.