Skip to content

Conversation

thanhdanh
Copy link
Contributor

@thanhdanh thanhdanh commented Mar 8, 2025

Summary

This PR fixes the issue where wretch was being called as a function but threw an error (wretch is not a function).

Screenshot 2025-03-08 at 03 41 41

The issue occurred because wretch.browser.js exports wretch as an ESModule default export, and when imported via require, the default export is wrapped inside a .default property. This fix explicitly accesses the .default property when importing wretch.browser.js in wretch.js, ensuring compatibility with CommonJS.

Tested on integration tests of tron-api, solana-api

@thanhdanh thanhdanh self-assigned this Mar 8, 2025
Copy link
Contributor

@roccomuso roccomuso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

Copy link

@feri42 feri42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK -- Was this also tested on platforms?

@thanhdanh
Copy link
Contributor Author

utACK -- Was this also tested on platforms?

Yes, tested on desktop build

@thanhdanh thanhdanh merged commit ac2c305 into master Mar 10, 2025
1 check passed
@thanhdanh thanhdanh deleted the andyvo/fix-wretch-import branch March 10, 2025 13:48
Copy link

🎉 This PR is included in version 1.7.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@roccomuso
Copy link
Contributor

@thanhdanh we don't have PRs for Mobile and BE?

@ChALkeR
Copy link
Contributor

ChALkeR commented Apr 9, 2025

I don't think this works.
Will file another PR.

@ChALkeR
Copy link
Contributor

ChALkeR commented Apr 9, 2025

Fix in #33

@ChALkeR
Copy link
Contributor

ChALkeR commented Apr 9, 2025

Side note: I'm unsure why we even have/need /wretch here nowadays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants