Search code examples
expoeas

'import.meta' is currently unsupported in eas build


I have a mobile app built with react native on top of Expo. I use eas to build and deploy it to the stores.

Recently, I upgraded the expo SDK from 48 to 50. After upgrading everything, when I try to build the app with eas, It's throwing the following error:

'import.meta' is currently unsupported

The weirdest part is, the line that is referencing is:

if ((import.meta.env && import.meta.env.MODE) !== "production") {

but I don't have that line anywhere in my source code.

Does anyone know what could be causing this?

I had never seen this error before upgrading the expo SDK.

Also, the app compiles successfully in my machine, and in eas when not targeting my production build.


Solution

  • I had the same issue, this is caused by a package you're using that has that code, and EAS can't build it. In my case it was zustand I downgraded to 3.7.2 to get that sorted.