Repository navigation
fix(babel): normalize resolved paths to POSIX so Windows rewrites work - #390
Open
YevheniiKotyrlo wants to merge 1 commit into
Open
YevheniiKotyrlo wants to merge 1 commit into
YevheniiKotyrlo wants to merge 1 commit into
Conversation
This was referenced Aug 15, 2026
Open
Contributor
Author
No device frameThe change is in the babel plugin's path handling, so it shows in the test suite rather than on a device. The description names the four relative-import cases |
This was referenced Sep 22, 2026
YevheniiKotyrlo
force-pushed
the
fix/babel-windows-posix-paths
branch
from
October 11, 2026 12:35
7f16078 to
576bb57
Compare
path.resolve separates with backslashes on Windows, so a relative import resolved against the file never matched the forward-slash package paths the handlers split on, and was left unrewritten.
YevheniiKotyrlo
force-pushed
the
fix/babel-windows-posix-paths
branch
from
October 11, 2026 18:15
576bb57 to
99f9dd8
Compare
This branch has not been deployed
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.
Problem
On Windows, the babel plugin leaves relative imports inside react-native and react-native-web unrewritten. The handlers resolve a relative source against the importing file and split the result on forward-slash paths (
react-native/Libraries/Components/,react-native-web/dist), butpath.resolveseparates with backslashes there, so the split never matches.Solution
resolveImportSourceinsrc/babel/helpers.tsresolves against the file's directory and joins the segments with/, and both handlers call it. On POSIX the separator is already/, so nothing changes there.Tests
No new test: four of
main's babel cases already fail on Windows and pass on Linux.yarn test src/__tests__/babelon WindowsmainThe four are
plugin › 1. rewrite imports from within React Native,react-native › 11. import View from '../View/View';, andreact-native-web › 10.and› 21..Verification
Every
ci.ymljob but the iOS build, on Ubuntu with Node 22.18.0: green, withyarn testat 1335 passed.The crash on a transform with no filename is now its own PR, #479.