Skip to content

Commit

Permalink
avoid resolving recursive main field (#7347)
Browse files Browse the repository at this point in the history
### Description

fixes PACK-2349

### Testing Instructions

<!--
  Give a quick description of steps to test your changes.
-->
  • Loading branch information
sokra committed Feb 14, 2024
1 parent d4ccb0b commit ac23620
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/turbopack-core/src/resolve/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1686,8 +1686,14 @@ async fn resolve_into_folder(
} => {
if let Some(package_json) = &*read_package_json(package_json_path).await? {
if let Some(field_value) = package_json[name].as_str() {
let request =
Request::parse(Value::new(normalize_request(field_value).into()));
let normalized_request = normalize_request(field_value);
if normalized_request.is_empty()
|| normalized_request == "."
|| normalized_request == "./"
{
continue;
}
let request = Request::parse(Value::new(normalized_request.into()));

let options = if let Some(extensions) = extensions {
options.with_extensions(extensions.clone())
Expand Down

0 comments on commit ac23620

Please sign in to comment.