Skip to content

Commit e490565

Browse files
committed
fix(expo-router): attach Icon + Label via post-assign — hbc bug
The previous attempt (acee218) added Icon + Label as plain entries inside the module.exports object literal. That worked locally but crashed the vendor.bundle.hbc on CI x86_64 — same silent blank-screen pattern as the URL polyfill v1 and the LogBoxOverlay regressions, tracked in task #69. The `blank` example flipped from PASS to BOOT_FAIL, which is downstream proof the shim crashed the host before any user code ran. Forward-only fix: keep the same Icon + Label slot exports, but attach them through post-assign (`module.exports.Icon = Slot; module.exports.Label = Slot;`) AFTER the literal is built. Different bytecode shape, dodges the bug.
1 parent acee218 commit e490565

1 file changed

Lines changed: 15 additions & 10 deletions

File tree

packages/@lucid-softworks/react-native-linux-expo/expo-router.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -701,16 +701,6 @@ module.exports = {
701701
NativeTabs: Object.assign(Tabs, {
702702
Trigger: Object.assign(Tabs.Screen, {Icon: Slot, Label: Slot}),
703703
}),
704-
// expo-router/build/native-tabs additionally hoists Icon + Label
705-
// as TOP-LEVEL named exports (`import {Icon, Label, NativeTabs}
706-
// from "expo-router/build/native-tabs"`). Userland renders
707-
// `<Icon sf="…" />` inside a `<NativeTabs.Trigger>`; without
708-
// top-level slots they resolve to undefined and React throws
709-
// "Element type is invalid" before the first frame. Same Slot
710-
// (renders children, ignores SF Symbol / drawable props) covers
711-
// both since we don't draw real icons on desktop yet.
712-
Icon: Slot,
713-
Label: Slot,
714704
Link,
715705
Slot,
716706
Redirect,
@@ -738,3 +728,18 @@ module.exports = {
738728
default: Stack,
739729
__esModule: true,
740730
};
731+
732+
// expo-router/build/native-tabs additionally hoists Icon + Label as
733+
// TOP-LEVEL named exports (`import {Icon, Label, NativeTabs} from
734+
// "expo-router/build/native-tabs"`). Userland renders `<Icon …/>`
735+
// inside `<NativeTabs.Trigger>`; without top-level slots they
736+
// resolve to undefined and React throws "Element type is invalid"
737+
// before the first frame.
738+
//
739+
// We attach them via post-assign rather than inside the literal
740+
// above. Adding them as plain entries on the literal pushed the
741+
// vendor.bundle.hbc into a Hermes x86_64 bytecode bug that
742+
// silently blank-screens the host (same shape as the URL polyfill
743+
// v1 + LogBoxOverlay regressions). Tracked in task #69.
744+
module.exports.Icon = Slot;
745+
module.exports.Label = Slot;

0 commit comments

Comments
 (0)