CityOfZion / neon-js

Javascript libraries that allow the applications to interact with NEO blockchain
https://docs.coz.io/neo3/neon-js/index.html
MIT License
183 stars 165 forks source link

Crash React Native Builded App using Neonjs 5.4.0 #901

Closed raulduartep closed 11 months ago

raulduartep commented 1 year ago

Hi, I am getting the error ReferenceError: Can't find variable: u when I try to open a builded React Native app using the Neonjs 5.4.0, but it's normal when I run the app with Expo.

I downgraded to the 5.3.0 version and the builded app works fine, so probably it's a issue that came up with the new version.

I have cloned neonjs and did some tests installing the lib as a local dependency in the app, with that, I came to the conclusion that what is causing this crash is the minimize of neon-core. I also have notice this commit https://github.com/CityOfZion/neon-js/commit/d675a05a2a337999070c855334043fa6e84d9e3e#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519 upgraded the version of some dependencies(Webpack and TenserPlugin) that may be causing the problem.

Can you help me ? :)

ixje commented 12 months ago

@snowypowers :point_up:

snowypowers commented 12 months ago

Im not too clear on what is happening here. Since you have a local test setup, have you tried reverting the updates to webpack and see if it works? The change also introduced a tsconfig update that changed the emitted js version, that might be another possible culprit.

Sorry but I dont have a RN setup so I cant exactly reproduce and debug it.

raulduartep commented 12 months ago

Yes, I have tried to do it, but I couldn't because this commit https://github.com/CityOfZion/neon-js/commit/a96afef14dc03ea526539ffad5021a891db25dde switched from yarn to npm, so how a new package-lock was created, the webpack updated with a slightly more updated version than the old one that was being used in yarn. A commit before it, everything works normally.

snowypowers commented 11 months ago

Can you try #904 and see if it fixes it in RN? Found a possible error to do with ascii vs utf8 chars.

raulduartep commented 11 months ago

@snowypowers It worked perfectly, thanks a lot. I only made one change which was to put your solution in the neon-core package, because that's where the error was. Maybe it's interesting to put it in all packages.

Again thank you very much.

raulduartep commented 11 months ago

@snowypowers Do you have any estimates of when a new version will be released?

snowypowers commented 11 months ago

I will let @ixje handle the releasing.