Skip to content

Commit

Permalink
Fix layer check
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Nov 27, 2024
1 parent f5179ef commit 9e3c57a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crates/next-api/src/dynamic_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,15 +282,16 @@ pub async fn map_next_dynamic(
.enumerate_nodes()
.map(|(_, module)| {
async move {
let is_ssr = match module.ident().await?.layer {
let is_browser = match module.ident().await?.layer {
Some(layer) => {
// TODO: compare module contexts instead?
let layer = &*layer.await?;
layer == "app-rsc" || layer == "app-ssr"
layer == "app-client" || layer == "client"
}
None => false,
};
if is_ssr {
// Only collect in RSC and SSR
if !is_browser {
if let Some(v) =
&*build_dynamic_imports_map_for_module(client_asset_context, *module)
.await?
Expand Down

0 comments on commit 9e3c57a

Please sign in to comment.