Only usable in React Native with experimental features due to Package Exports?
This library seems to use Package Exports. Support for Package Exports in Metro is only in beta: https://metrobundler.dev/docs/package-exports/. If the unstable_enablePackageExports is not enabled, an error will occur when attempting to import @t3-oss/env-core, see https://github.com/koengommers/t3-env-expo-issue-repro
Is there some other way to use this library in React Native without having to enable an unstable feature?
For anyone here still running into this issue after setting unstable_enablePackageExports:
iOS Bundling failed 643ms node_modules/expo-router/entry.js (3235 modules)
The package at "node_modules/axios/dist/node/axios.cjs" attempted to import the Node standard library module "url".
It failed because the native React runtime does not include the Node standard library.
Learn more: https://docs.expo.dev/workflow/using-libraries/#using-third-party-libraries
I've also had to add 'browser' to unstable_conditionNames. Full working metro config:
// Support @t3-oss/env-core
config.resolver.unstable_enablePackageExports = true
config.resolver.unstable_conditionNames = ['browser', ...config.resolver.unstable_conditionNames]
For anyone here still running into this issue after setting
unstable_enablePackageExports:iOS Bundling failed 643ms node_modules/expo-router/entry.js (3235 modules) The package at "node_modules/axios/dist/node/axios.cjs" attempted to import the Node standard library module "url". It failed because the native React runtime does not include the Node standard library. Learn more: https://docs.expo.dev/workflow/using-libraries/#using-third-party-librariesI've also had to add
'browser'tounstable_conditionNames. Full working metro config:// Support @t3-oss/env-core config.resolver.unstable_enablePackageExports = true config.resolver.unstable_conditionNames = ['browser', ...config.resolver.unstable_conditionNames]
this should be in the documentation.
bad idea. I tried to implement this library with these configs. It worked normally until I tried to build the app
the app in production just doesn't work; it always crashes. don't know if this is due to the configs or the library itself
bad idea. I tried to implement this library with these configs. It worked normally until I tried to build the app
the app in production just doesn't work; it always crashes. don't know if this is due to the configs or the library itself
Hey this is because expo has a way of replacing process.env occurrences as constants during build time, and cant recognize .env :(