Hello,
It seems we still have an issue with TypeBox and Expo / Metro bundler.
- Expo SDK 54 (React Native 0.81)
- Metro bundler with Babel
- TypeBox 1.0.71
Reproduction Steps
npx create-expo-app@latest my-app
cd my-app
npm install typebox
Add import in app/(tabs)/index.tsx:
Run:
Error
ERROR [TypeError: Cannot read property 'defineProperty' of undefined]
Root Cause
In src/type/types/object.ts:
export var Object = _Object_
Metro + Babel transforms this in a way that shadows the global Object, breaking Object.defineProperty calls.
Potential Fix
Replace the line with:
export { _Object_ as Object }
Related Issues
Thanks for looking into this!
Hello,
It seems we still have an issue with TypeBox and Expo / Metro bundler.
Reproduction Steps
npx create-expo-app@latest my-app cd my-app npm install typeboxAdd import in
app/(tabs)/index.tsx:Run:
Error
Root Cause
In
src/type/types/object.ts:Metro + Babel transforms this in a way that shadows the global
Object, breakingObject.definePropertycalls.Potential Fix
Replace the line with:
Related Issues
Thanks for looking into this!