I'm upgrading my React Native project to a newer version. What I’ve done for this:
When I try to run the project, I get the error in the node_modules
folder:
ERROR SyntaxError: [ROOT_FOLDER]/node_modules/react-native/Libraries/vendor/emitter/EventEmitter.js:
Unexpected token, expected "]" (39:5)
37 |
38 | type Registry<TEventToArgsMap: {...}> = {
> 39 | [K in keyof TEventToArgsMap]: Set<Registration<TEventToArgsMap[K]>>,
| ^
40 | };
41 |
42 | /**
Steps Tried:
Search on the internet, found simailar issue but not related to mine. https://github.com/puppeteer/puppeteer/issues/10509
If you updated your react native project, check your @react-native/etc
Config file:
and see it's the same as the one up top, there's an update at react native 0.76.4 which fixes that issue
Source: https://github.com/facebook/react-native/issues/46355
Edit: Found this because was searching for the same error myself, this fixed it for me