I'm getting unexpected token '?' error. But, on debug mode, the error disappears.
This is a little bit late but I think it may help other
In my case, This issue happen to me after I install an example app with:
"metro-config": "^0.72.1" and "react-native": "0.70.0-rc.4". while my main app still using "react-native": "0.66.4"
It also replicated when I revert the code. So I came up with this solution:
yarn cache clean and npm cache clean -fAnd the problem dissapear.