Skip to content

fix: correct require.resolve usage in React Native quickstart#126

Open
moss-bryophyta wants to merge 1 commit intogeneraltranslation:mainfrom
moss-bryophyta:fix/rn-quickstart-require-resolve
Open

fix: correct require.resolve usage in React Native quickstart#126
moss-bryophyta wants to merge 1 commit intogeneraltranslation:mainfrom
moss-bryophyta:fix/rn-quickstart-require-resolve

Conversation

@moss-bryophyta
Copy link
Copy Markdown
Collaborator

Fix

require.resolve(__dirname, 'App.tsx') in the bare React Native quickstart Babel config example is incorrect — require.resolve() takes a single module specifier string, not two positional arguments. This would throw at runtime.

Changed to require.resolve('./App.tsx') which correctly resolves relative to the config file.

The Expo quickstart already uses the correct single-argument form (require.resolve('expo-router/entry')).

require.resolve() takes a single module specifier string, not two
positional arguments. require.resolve(__dirname, 'App.tsx') would fail
at runtime. Changed to require.resolve('./App.tsx') which correctly
resolves relative to the current file.
@moss-bryophyta moss-bryophyta requested a review from a team as a code owner March 13, 2026 15:03
@moss-bryophyta moss-bryophyta enabled auto-merge (squash) March 13, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant