File tree Expand file tree Collapse file tree
turbopack/crates/turbopack-core/src/resolve Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2112,14 +2112,19 @@ async fn resolve_internal_inline(
21122112 if let Some ( fs_path) = disk_fs. try_from_sys_path ( disk_fs_vc, sys_path, None )
21132113 {
21142114 let root_path = disk_fs_vc. root ( ) . owned ( ) . await ?;
2115+ // Windows absolute requests should be normalized through the
2116+ // filesystem root. Otherwise an absolute request can keep the
2117+ // importer's lookup path in the resolved identity chain, which may
2118+ // create a different module record from a relative request to the same
2119+ // physical file.
21152120 let ( relative_lookup_path, relative_path) = if let Some ( relative_path) =
2116- lookup_path. get_relative_path_to ( & fs_path)
2117- {
2118- ( lookup_path. clone ( ) , relative_path)
2119- } else if let Some ( relative_path) =
21202121 root_path. get_relative_path_to ( & fs_path)
21212122 {
21222123 ( root_path. clone ( ) , relative_path)
2124+ } else if let Some ( relative_path) =
2125+ lookup_path. get_relative_path_to ( & fs_path)
2126+ {
2127+ ( lookup_path. clone ( ) , relative_path)
21232128 } else {
21242129 continue ;
21252130 } ;
You can’t perform that action at this time.
0 commit comments