Skip to content

Commit

Permalink
fix(next-core): refine context for unsupported edge imports
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed Mar 22, 2024
1 parent c21b8f5 commit 65e7e27
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/next-swc/crates/next-core/src/next_import_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,22 @@ pub async fn get_next_edge_import_map(
)
.await?;

insert_unsupported_node_internal_aliases(&mut import_map, project_path, execution_context);
// Look for where 'server/web/globals.ts` are imported to find out corresponding
// context
match ty {

Check failure on line 474 in packages/next-swc/crates/next-core/src/next_import_map.rs

View workflow job for this annotation

GitHub Actions / rust check / build

Diff in /root/actions-runner/_work/next.js/next.js/packages/next-swc/crates/next-core/src/next_import_map.rs
ServerContextType::AppSSR { .. }
| ServerContextType::AppRSC { .. }
| ServerContextType::AppRoute {.. }
| ServerContextType::Middleware { .. }
| ServerContextType::PagesApi { .. } => {
insert_unsupported_node_internal_aliases(
&mut import_map,
project_path,
execution_context,
);
}
_ => {}
}

Ok(import_map.cell())
}
Expand Down

0 comments on commit 65e7e27

Please sign in to comment.