software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
8.97k stars 1.3k forks source link

error: Unexpected token "=" error #4825

Closed CavanWagg closed 1 year ago

CavanWagg commented 1 year ago

Description

error: unexpected token "=" error.

Screenshot_1690338548

Steps to reproduce

  1. yarn start
  2. run yarn android to build on a physical device or simulator
  3. when the app starts up you'll immediately see the error

Snack or a link to a repository

https://github.com/CavanWagg/react-native-reanimated-error

Reanimated version

3.4.0

React Native version

0.69.1

Platforms

Android

JavaScript runtime

JSC

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

None

Device

Real device

Device model

Moto g power (Android 11)

Acknowledgements

Yes

yannickvidal commented 1 year ago

This error happens because of the use of the Logical AND assignment (&&=) in the v3.4.0 release: https://github.com/software-mansion/react-native-reanimated/blob/d1365463deccde05b63b1b67b8e54c7b2bb6c2ea/src/reanimated2/animation/util.ts#L206

We have tried adding Babel support using this package @babel/plugin-proposal-logical-assignment-operators, but we are also still experiencing the same issue.

If this makes any difference, we are running on Node 14.x.

For now, we will revert back to using v3.3.0 to solve our build issue.

siddarthkay commented 1 year ago

Thanks @yannickvidal !

I was also facing the same issue with react-native-reanimated version 3.4.1 I can say that downgrading to version 3.3.0 fixed this issue for me.

ref PR : https://github.com/status-im/status-mobile/pull/17241

siddarthkay commented 1 year ago

An update on this, I just now upgraded react-native-reanimated to version 3.5.4

I had to do this upgrade because we were testing a new ndkversion r25c and react-native-reanimated 3.3.0 relied on ndk r23.

you can find more details here : https://github.com/status-im/status-mobile/pull/17241/commits/946e3d8fcc37499358a017afefdb5385b48283ac Happy to report that version 3.5.4 also does not have this issue.

see2ever commented 2 months ago

btw, in "query-string" package, they use &&= too