Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native bundling: SyntaxError: Unexpected token: operator (*)

When I run attempt to bundle my app with:

react-native bundle --platform ios --dev false \
    --entry-file index.ios.js --bundle-output iOS/main.jsbundle

I get the following error, with no other details:

SyntaxError: Unexpected token: operator (*)

For what it's worth, this works (with --dev true):

react-native bundle --platform ios --dev true \
    --entry-file index.ios.js --bundle-output iOS/main.jsbundle

My best guess is that the issue is somewhere in an UglifyJS step, perhaps related to:

https://github.com/mishoo/UglifyJS2/issues/1199

Any tips? Suggestions for where to dig deeper are welcome! Thanks!

like image 519
Max Heinritz Avatar asked May 10 '26 12:05

Max Heinritz


1 Answers

We found the line number with:

./node_modules/.bin/esvalidate --formatter=sublime.js ios/main.jsbundle

The issue was the use of the ** ES6 operator. Reverted to Math.pow().

like image 67
Max Heinritz Avatar answered May 12 '26 03:05

Max Heinritz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!