You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bf2e0df
Browse filesBrowse the repository at this point in the historyBrowse files
feat: suggest the closest file name when a module is not found (#21727)
When resolving fails and no other hint applies, look at the request's
directory and name the entry it comes closest to. A name that only
differs in casing gets an explicit note, since such a build succeeds on
a case-insensitive filesystem and fails on a case-sensitive one.
'${closest.entry}' exists in that directory and differs from the request only in casing. Case-sensitive filesystems (most Linux ones) fail to resolve it, even when the same build succeeds on a case-insensitive one.`
1398
+
: `Did you mean '${suggestion}'?
1399
+
'${closest.entry}' is the closest name in that directory. It differs from the request by ${closest.distance===1 ? "1 character" : `${closest.distance} characters`}, ignoring case and file extension.`
1400
+
);
1401
+
});
1402
+
};
1403
+
1270
1404
asyncLib.parallel(
1271
1405
[
1272
1406
(callback)=>{
@@ -1368,7 +1502,11 @@ If changing the source code is not an option there is also a resolve options cal
Copy file name to clipboardExpand all lines: test/Errors.test.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -321,7 +321,7 @@ describe("Errors", () => {
321
321
"errors": Array [
322
322
Object {
323
323
"loc": "2:0-17",
324
-
"message": "Module not found: Error: Can't resolve './FILE' in '<cwd>/test/fixtures/errors'",
324
+
"message": "Module not found: Error: Can't resolve './FILE' in '<cwd>/test/fixtures/errors'\\nDid you mean './file.js'?\\n'file.js' exists in that directory and differs from the request only in casing. Case-sensitive filesystems (most Linux ones) fail to resolve it, even when the same build succeeds on a case-insensitive one.",
0 commit comments