Skip to content

Commit

Permalink
add missing alias for next/dynamic in app dir (#49199)
Browse files Browse the repository at this point in the history
### What?

RSC also needs a different next/dynamic on client side

Co-authored-by: Jiachi Liu <inbox@huozhi.im>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored May 4, 2023
1 parent 310407d commit b7e2a28
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/next-swc/crates/next-core/src/next_import_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ pub async fn get_next_client_import_map(
"react-server-dom-webpack/",
request_to_import_mapping(app_dir, "next/dist/compiled/react-server-dom-webpack/*"),
);
import_map.insert_exact_alias(
"next/dynamic",
request_to_import_mapping(project_path, "next/dist/shared/lib/app-dynamic"),
);
}
ClientContextType::Fallback => {}
ClientContextType::Other => {}
Expand Down

0 comments on commit b7e2a28

Please sign in to comment.