Repository navigation
Conversation
Contributor
|
@vzaidman has exported this pull request. If you are a Meta employee, you can view the originating Diff in D120317319. |
vzaidman
added a commit
to vzaidman/metro
that referenced
this pull request
Sep 29, 2026
Summary: When Metro cannot find a module being imported, it shows an error with a small preview of your code around that import. Some build tools automatically add imports while transforming your code. Those added imports can point to a line number that does not exist in your saved file. Before this change, Metro crashed while building that preview, which hid the real "Unable to resolve module" error. Now Metro skips lines that do not exist in the file and still shows the real error with a preview of the lines that do exist. Changes: - ModuleResolution.js: skip missing lines when searching for the import location, falling back to the default location. - Adds an integration test with a Babel plugin that appends an unresolvable import past the end of the file. Original contribution from react#1226 by evanbacon. Changelog: [Fix] Fixed a crash when building the error preview for an unresolvable import pointing past the end of the file (for example, imports added automatically during the build). Metro now skips the missing lines and reports the real "Unable to resolve module" error. ([react#1226](react#1226) by [evanbacon](https://github.com/evanbacon)) Reviewed By: cipolleschi Differential Revision: D120317319
vzaidman
force-pushed
the
export-D120317319
branch
from
September 29, 2026 07:00
ec7bb2c to
4e802af
Compare
vzaidman
added a commit
to vzaidman/metro
that referenced
this pull request
Sep 29, 2026
Summary: When Metro cannot find a module being imported, it shows an error with a small preview of your code around that import. Some build tools automatically add imports while transforming your code. Those added imports can point to a line number that does not exist in your saved file. Before this change, Metro crashed while building that preview, which hid the real "Unable to resolve module" error. Now Metro skips lines that do not exist in the file and still shows the real error with a preview of the lines that do exist. Changes: - ModuleResolution.js: skip missing lines when searching for the import location, falling back to the default location. - Adds an integration test with a Babel plugin that appends an unresolvable import past the end of the file. Original contribution from react#1226 by evanbacon. Changelog: [Fix] Fixed a crash when building the error preview for an unresolvable import pointing past the end of the file (for example, imports added automatically during the build). Metro now skips the missing lines and reports the real "Unable to resolve module" error. ([react#1226](react#1226) by [evanbacon](https://github.com/evanbacon)) Reviewed By: cipolleschi Differential Revision: D120317319
vzaidman
force-pushed
the
export-D120317319
branch
from
September 29, 2026 07:00
4e802af to
5118ae5
Compare
Summary: Pull Request resolved: react#1993 When Metro cannot find a module being imported, it shows an error with a small preview of your code around that import. Some build tools automatically add imports while transforming your code. Those added imports can point to a line number that does not exist in your saved file. Before this change, Metro crashed while building that preview, which hid the real "Unable to resolve module" error. Now Metro skips lines that do not exist in the file and still shows the real error with a preview of the lines that do exist. Changes: - ModuleResolution.js: skip missing lines when searching for the import location, falling back to the default location. - Adds an integration test with a Babel plugin that appends an unresolvable import past the end of the file. Original contribution from react#1226 by evanbacon. Changelog: [Fix] Fixed a crash when building the error preview for an unresolvable import pointing past the end of the file (for example, imports added automatically during the build). Metro now skips the missing lines and reports the real "Unable to resolve module" error. ([react#1226](react#1226) by [evanbacon](https://github.com/evanbacon)) Reviewed By: cipolleschi Differential Revision: D120317319
vzaidman
force-pushed
the
export-D120317319
branch
from
September 29, 2026 07:02
5118ae5 to
0afacc6
Compare
Collaborator
|
Just curious - was something broken about the original PR/import? |
Contributor
Author
Problems with diff train for diffs imported before the diff train. I'm not sure what's the best way to fix it though |
Contributor
Author
|
@robhogan Ahhh nvm, I just landed the original one DOHHH |
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.
Summary:
When Metro cannot find a module being imported, it shows an error with a small preview of your code around that import. Some build tools automatically add imports while transforming your code. Those added imports can point to a line number that does not exist in your saved file. Before this change, Metro crashed while building that preview, which hid the real "Unable to resolve module" error. Now Metro skips lines that do not exist in the file and still shows the real error with a preview of the lines that do exist.
Changes:
Original contribution from #1226 by evanbacon.
Changelog:
[Fix] Fixed a crash when building the error preview for an unresolvable import pointing past the end of the file (for example, imports added automatically during the build). Metro now skips the missing lines and reports the real "Unable to resolve module" error. (react/metro#1226 by evanbacon)
Reviewed By: cipolleschi
Differential Revision: D120317319