Skip to content

Commit 54eb91b

Browse files
committed
fix: check if id changed before resolving again
1 parent c26182e commit 54eb91b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/index.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,11 @@ const createExtendedMatchPath: typeof createMatchPath = (
177177
return (id, ...otherArgs) => {
178178
const match = matchPath(id, ...otherArgs)
179179
if (match != null) return match
180-
return matchPath(removeJsExtension(id), ...otherArgs)
180+
181+
const idWithoutJsExt = removeJsExtension(id)
182+
if (idWithoutJsExt !== id) {
183+
return matchPath(idWithoutJsExt, ...otherArgs)
184+
}
181185
}
182186
}
183187

0 commit comments

Comments
 (0)