Unable to use in React Native due to import.meta not being supported #1967
Replies: 2 comments 36 replies
-
If import.meta isn't supported, it means ESM isn't supported, I guess. Our intentional workaround is to use "module" condition instead of "import" condition, but I'm afraid Hermes doesn't support those conditions in the first place. 🤔 @barelyhuman Do we have similar issues reported? We use the same config across zustand/jotai/valtio, and I suspect there are RN users who use Hermes... |
Beta Was this translation helpful? Give feedback.
-
Coming here as a user of Jotai but having ran into the same issue. First off, this issue is only apparent when using the metro config From here, metro runs by the A fix for expo users with
Patching my local version, i've confirmed this to work on local projects. Note that while i've veered away from turning on |
Beta Was this translation helpful? Give feedback.
-
React Native's Hermes JavaScript engine doesn't support import.meta and exits with an error at compile time, so testing for its existence in code doesn't work. I'm tempted to file a bug for this against Hermes but wondered whether any way around this already existed for Zustand?
Beta Was this translation helpful? Give feedback.
All reactions