From 36afda447961035cf9d8f8c0a66543d69d9c3c69 Mon Sep 17 00:00:00 2001 From: Justin Ridgewell Date: Fri, 15 Sep 2023 00:10:05 -0400 Subject: [PATCH] Turbopack: remap `next/head` on client in App Pages (#55419) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### What? Remaps `next/head` to `next/dist/client/components/noop-head` on the client inside an App Page. ### Why? Because webpack bundles do it. ### How? We were just missing an import remap. 🤦 Closes WEB-1573 --- packages/next-swc/crates/next-core/src/next_import_map.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/next-swc/crates/next-core/src/next_import_map.rs b/packages/next-swc/crates/next-core/src/next_import_map.rs index 93572d8a68a90..98d73a83454b7 100644 --- a/packages/next-swc/crates/next-core/src/next_import_map.rs +++ b/packages/next-swc/crates/next-core/src/next_import_map.rs @@ -109,6 +109,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/head", + request_to_import_mapping(project_path, "next/dist/client/components/noop-head"), + ); import_map.insert_exact_alias( "next/dynamic", request_to_import_mapping(project_path, "next/dist/shared/lib/app-dynamic"),