solana-labs / solana-web3.js

Solana JavaScript SDK
https://solana-labs.github.io/solana-web3.js
MIT License
1.97k stars 791 forks source link

Bug in @solana/errors #2903

Closed lukecaan closed 2 days ago

lukecaan commented 2 days ago

Tldr; a bad regex string in @solana/errors is makes old (<16.4) iOS browsers crash

..

Hi, the same issue which was reported here https://github.com/solana-labs/solana-web3.js/pull/2745, and ended up being fixed here https://github.com/solana-labs/solana-web3.js/pull/2785/files is rearing its head again.

The issue this time appears to be @solana/errors, which is a nested dependency of @solana/spl-token > @solana/spl-token-metadata > @solana/solana-codecs > @solana/solana/errors

It looks like the latest version of the code in packages/errors should actually be fine - but if you pull the latest bundled code from npm it is still using the broken version of getHumanReadableErrorMessage

image

^ The negative lookbehind regex is the problem. You can see the broken version of the method in the npm bundled code if you go here https://www.npmjs.com/package/@solana/errors/v/2.0.0-preview.3?activeTab=code and look insidedist/cli.js

I think doing a few fresh releases making things look at newer package versions will fix it

cc @steveluscher

steveluscher commented 2 days ago

Super coincidence, but we're doing a release of TP4 today!

steveluscher commented 2 days ago

https://github.com/solana-labs/solana-web3.js/releases/tag/tp4

lukecaan commented 1 day ago

@steveluscher thank you! 🙌