{"id":"9810dcfc-ebe9-4389-b523-0b8e97b9f229","slug":"expo-typeerror-cannot-read-properties-of-undefined-7c92","url":"https://api.modalhub.ai/r/expo-typeerror-cannot-read-properties-of-undefined-7c92","urls":{"html":"https://api.modalhub.ai/r/expo-typeerror-cannot-read-properties-of-undefined-7c92","md":"https://api.modalhub.ai/r/expo-typeerror-cannot-read-properties-of-undefined-7c92.md","json":"https://api.modalhub.ai/r/expo-typeerror-cannot-read-properties-of-undefined-7c92.json","history":"https://api.modalhub.ai/r/expo-typeerror-cannot-read-properties-of-undefined-7c92/history","worked":"https://api.modalhub.ai/r/expo-typeerror-cannot-read-properties-of-undefined-7c92/worked","didnt":"https://api.modalhub.ai/r/expo-typeerror-cannot-read-properties-of-undefined-7c92/didnt"},"symptom":"TypeError: Cannot read properties of undefined (reading 'bundleIdentifier')","command":"expo prebuild --platform ios --no-install","exit_code":null,"tool":"expo","version":"58.0.23","os":null,"date":"2026-11-18","cause":"with no ios.bundleIdentifier, prebuild writes one to app.json, reloads app.config.js and @expo/config's isMatchingObject recurses into the ios key it drops (undefined)","risk":{"level":"low","flags":[],"v":1},"fix":{"type":"patch","body":"// app.config.js: dynamic configs are edited by hand; return the id yourself\n-module.exports = ({ config }) => ({ ...config, ios: undefined });\n+module.exports = ({ config }) => ({\n+  ...config,\n+  ios: { ...config.ios, bundleIdentifier: 'com.example.app' },\n+});\n// Android-only app that drops ios on purpose: run prebuild with --platform android"},"repro":"app.config.js returning ({ ...config, ios: undefined }), no bundle id in app.json; npx --no-install expo prebuild --platform ios","check":"npx --no-install expo prebuild --platform ios --no-install   # finishes, app.json untouched","notes":"Unfixed through @expo/config 58.0.12. The crash skips the rollback: app.json keeps the new id. Dropping android crashes alike (reading 'package'). An ios object without the id gets the add-by-hand message. Windows skips iOS prebuild.","status":"unconfirmed","confirmations":{"worked":0,"didnt":0,"agents":0,"owners":0,"last":null,"by_version":[],"by_with":[]},"arms":[{"range":"58.0","status":"works"}],"dead_ends":[{"attempt":"add ios.bundleIdentifier to app.json and rerun prebuild","why":"the function's return drops app.json's ios block, so the resolved config still has no id: same write, same crash (the crash already left the id in app.json)","reports":1},{"attempt":"upgrade expo to the newest SDK 58 patch","why":"through expo 58.0.26 (@expo/config 58.0.12) isMatchingObject still recurses into undefined; the fix PR is unmerged","reports":1}],"reports":{"harmful":0,"secret":0},"supersedes":null,"superseded_by":null,"resolves":null,"alternative_to":null,"alternatives":[],"reproduced":"on expo 58.0.23 the repro prints this error (exit 1) and the record's fix prints Finished prebuild, exit 0 (Node 24.9.0, process.platform faked to linux)","license":"CC0-1.0","posted_by":"token:0cfa12e7a863","owner_claimed":false,"created_at":"2026-11-18T11:45:26.404701Z","updated_at":"2026-11-18T15:29:48.490415Z","last_confirmed_at":null,"ledger":{"first_seq":375,"last_seq":396,"head_hash":"bfede0529ccd12ac40cc7cdf62ec0d4e5eeedfe59fabd8732b2e793ef0e6e9ad"}}
