react-native-reanimated: Compiling JS failed: Invalid expression Buffer size
Description
Starting with Version 3.4.0 I get the error Compiling JS failed: 232124:78:invalid expression Buffer size 17924054 starts with: 766172205f5f42554444c455f535441 (see screenshot).
I stayed with version 3.3.0 for as long as I could (up to React Native 0.71) but now that I’m finally upgrading my app to React Native 0.73 I need to upgrade to at least 3.6.0 and desperately need a fix for this.
Steps to reproduce
- Install “react-native-reanimated” >= 3.4.0
- Run app on iOS
Snack or a link to a repository
n.a.
Reanimated version
3.8.0
React Native version
0.73.6
Platforms
Android, iOS
JavaScript runtime
Hermes
Workflow
React Native
Architecture
Paper (Old Architecture)
Build type
Debug app & dev bundle
Device
iOS simulator
Device model
iPhone 15 Pro (iOS 17)
Acknowledgements
Yes
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (2 by maintainers)
@DanielKuhn I looked into your package.json and yarn.lock, created new RN App using 0.73.6, copied your package.json and yarn.lock there, removed all irrelevant dependencies and everything worked fine.
From what I see
react-native-svg-transfomeradds a bunch of babel plugins, however I don’t know if you are actually using them - could it possible be the culprit?Unfortunately, since there seems to be no problems with brand new apps it seems that the issue is somewhere on your side. There are some additional steps I would suggest here:
npx react-native init App --version 0.73.6, add Reanimated, use it and see if the problem persists - if it does, then there’s something wrong with your machine configuration.yarn cache clean.metro.config.js:Closing the issue since its irreproducible and seems to be tied to the user’s environment issues. I’m happy to reopen the issue once a reliable reproduction is available.
I for my part forked
react-native-reanimatedat version 3.8.1 and simply pointed “react-native” to “lib/module/index” inpackage.jsonin the fork. I found changingresolverMainFieldsglobally in my app too risky because I don’t know which side-effects this might have in other packages and the typescript compilation mentioned here is only a problem inreact-native-reanimated.This seems like outdated
@babel/preset-typescriptpotentially. Try to upgrade it (regenerating yarn.lock should do the trick).