loading...

re: Expo SDK 38 is now available VIEW POST

FULL DISCUSSION
 

Hi, sorry to bother.
I tried upgrading from sdk 37 to 38 and it worked fine, but whenever I run expo start I get this error:

Failed building JavaScript bundle.
SyntaxError: /Users/Wesley/projects/app/node_modules/react-native-safe-area-context/src/SafeArea.types.ts: Unexpected token, expected ";" (42:19)

  40 |   children?: React.ReactNode;
  41 |   mode?: 'padding' | 'margin';
> 42 |   edges?: readonly Edge[];
     |                    ^
  43 | };
  44 |

I followed the tutorial and updated the expo-cli before running expo upgrade. I tried doing it again but got the same error. Tried deleting node modules because I thought it could be some conflict with an older version but it didn't work either. I'm not sure what's wrong since this safe-area module is a dependency from the expo package and I don't use it anywhere else.

 

Did you ever get this resolved? Running into the same issue as well.

 

Update: Seems like a week or so after sdk 38 was released with react-native-safe-area-context v3.0.3 and by the time of updating, it's now v3.0.7 which might be why this is happening, a dev added readonly to the type def is what it seems from the repo, see here -> github.com/th3rdwave/react-native-...

Updating my node version to latest v14.0.5 (at the time of this writing) seems to solve this for me. In addition, I deleted node_modules, yarn.lock, cleared expo cache (yarn cache clean or npm cache clean) and reinstalled everything a fresh. Even after all this, there were some dependancies that weren't added by expo and all I needed to do after was expo add <dependency_name>, hope this helps.

Thank you so much! It worked for me as well =)

Happy to hear that :)

Code of Conduct Report abuse