-
Notifications
You must be signed in to change notification settings - Fork 674
fix(metro-config): Convert absolute paths to file URL before calling await import #1620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
kitten
wants to merge
1
commit into
facebook:main
from
kitten:@kitten/fix/absolute-path-config-windows
Closed
fix(metro-config): Convert absolute paths to file URL before calling await import #1620
kitten
wants to merge
1
commit into
facebook:main
from
kitten:@kitten/fix/absolute-path-config-windows
Conversation
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
3 tasks
Contributor
3 tasks
kitten
added a commit
to expo/expo
that referenced
this pull request
Dec 16, 2025
…`resolveConfig` loading (#41142) # Why Not too many relevant changes should be brought in by `metro@0.83.3`, but the most important one we're looking for is: facebook/metro@af3bcca We're still seeing obfuscated errors on Windows. When `require` fails `metro-config` falls back to `await import` but passes an absolute path to it, which is invalid, see: facebook/metro#1620 The typings changes are partially drive-by changes, but it's easier to keep track of the config types now. # How - Upgrade to `@expo/metro@54.2.0` - Ensure `getDefaultConfig` in `@expo/metro-config` returns exact types - Bypass `loadConfig` implementation from Metro and only run `resolveConfig` # Test Plan - CI # Checklist <!-- Please check the appropriate items below if they apply to your diff. --> - [x] I added a `changelog.md` entry and rebuilt the package sources according to [this short guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
kitten
added a commit
to expo/expo
that referenced
this pull request
Dec 16, 2025
…`resolveConfig` loading (#41142) Not too many relevant changes should be brought in by `metro@0.83.3`, but the most important one we're looking for is: facebook/metro@af3bcca We're still seeing obfuscated errors on Windows. When `require` fails `metro-config` falls back to `await import` but passes an absolute path to it, which is invalid, see: facebook/metro#1620 The typings changes are partially drive-by changes, but it's easier to keep track of the config types now. - Upgrade to `@expo/metro@54.2.0` - Ensure `getDefaultConfig` in `@expo/metro-config` returns exact types - Bypass `loadConfig` implementation from Metro and only run `resolveConfig` - CI <!-- Please check the appropriate items below if they apply to your diff. --> - [x] I added a `changelog.md` entry and rebuilt the package sources according to [this short guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
aleqsio
pushed a commit
to expo/expo
that referenced
this pull request
Dec 22, 2025
…`resolveConfig` loading (#41142) # Why Not too many relevant changes should be brought in by `metro@0.83.3`, but the most important one we're looking for is: facebook/metro@af3bcca We're still seeing obfuscated errors on Windows. When `require` fails `metro-config` falls back to `await import` but passes an absolute path to it, which is invalid, see: facebook/metro#1620 The typings changes are partially drive-by changes, but it's easier to keep track of the config types now. # How - Upgrade to `@expo/metro@54.2.0` - Ensure `getDefaultConfig` in `@expo/metro-config` returns exact types - Bypass `loadConfig` implementation from Metro and only run `resolveConfig` # Test Plan - CI # Checklist <!-- Please check the appropriate items below if they apply to your diff. --> - [x] I added a `changelog.md` entry and rebuilt the package sources according to [this short guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
Contributor
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Merged
Shared with Meta
Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
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.
Summary
Errors may be swallowed in
require, which then cascades the error toawait import. However, this may then trigger an error on Windows since absolute Windows paths cannot be passed toawait importand need to be file URLs instead (C:orD:look like protocols toimportotherwise)We could also expose the error from
requireinstead if thecodes match a set of allowed (or not match a set of disallowed) error codes, but it's hard to get a comprehensive list for those without testing across all Node LTS versions.Changelog: [Fix] Prevent absolute path error on
await import()for Windows absolute pathsTest plan
This is admittedly a speculative fix, and I still need to test this, but I've only observed this in Expo CI for now.