Repository navigation
fix(example): load the runtime components entry so iOS dev builds start - #604
Merged
danstepanov merged 1 commit intoDec 4, 2026
Merged
Conversation
sammoore
force-pushed
the
fix/example-components-entry
branch
from
December 3, 2026 21:58
8386127 to
c76967c
Compare
The root tsconfig maps react-native-css/* to ./src/*, so the example's Metro resolved react-native-css/components to src/components/index.ts, the types-only entry. Babel compiles its `export * from "react-native"` into __esModule getters, and Fast Refresh reads every one, including PushNotificationIOS. Its native module isn't linked by default, so iOS's NativeEventEmitter threw and the app crashed at startup. Redirect that resolution to src/components/index.cts, the lazy CommonJS entry the package's exports map already gives apps, and add cts to sourceExts so Metro tracks it. Published installs were never affected.
danstepanov
force-pushed
the
fix/example-components-entry
branch
from
December 4, 2026 03:30
c76967c to
34fe2f4
Compare
danstepanov
approved these changes
Dec 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The example app crashes at startup on iOS in dev with
Invariant Violation: `new NativeEventEmitter()` requires a non-null argument.The root tsconfig maps
react-native-css/*to./src/*, so the example's Metro resolvesreact-native-css/componentstosrc/components/index.ts(the types-only entry). Babel compiles itsexport * from "react-native"into__esModulegetters, and Fast Refresh reads all of them, includingPushNotificationIOS. Its native module (React-RCTPushNotification) isn't linked by default, so iOS'sNativeEventEmitterthrows.This redirects that resolution to
src/components/index.cts, the lazy CommonJS entry thatexportsalready gives apps, and addsctstosourceExtsso Metro tracks it.Example-only; published installs resolve
index.cjsand were never affected.