File tree 3 files changed +9
-6
lines changed
next-swc/crates/next-core/src
3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -249,10 +249,6 @@ pub async fn get_next_server_import_map(
249
249
import_map. insert_wildcard_alias ( "react-dom/" , external) ;
250
250
import_map. insert_exact_alias ( "styled-jsx" , external) ;
251
251
import_map. insert_wildcard_alias ( "styled-jsx/" , external) ;
252
- import_map. insert_exact_alias (
253
- "react-server-dom-webpack/" ,
254
- ImportMapping :: External ( Some ( "react-server-dom-turbopack" . into ( ) ) ) . cell ( ) ,
255
- ) ;
256
252
// TODO: we should not bundle next/dist/build/utils in the pages renderer at all
257
253
import_map. insert_wildcard_alias ( "next/dist/build/utils" , external) ;
258
254
}
@@ -267,6 +263,10 @@ pub async fn get_next_server_import_map(
267
263
"next/dynamic" ,
268
264
request_to_import_mapping ( project_path, "next/dist/shared/lib/app-dynamic" ) ,
269
265
) ;
266
+ import_map. insert_exact_alias (
267
+ "react-server-dom-webpack/" ,
268
+ ImportMapping :: External ( Some ( "react-server-dom-turbopack" . into ( ) ) ) . cell ( ) ,
269
+ ) ;
270
270
}
271
271
ServerContextType :: Middleware => { }
272
272
}
Original file line number Diff line number Diff line change 1
1
import { appBootstrap } from './app-bootstrap'
2
2
3
3
appBootstrap ( ( ) => {
4
+ // This import must go first because it needs to patch webpack chunk loading
5
+ // before React patches chunk loading.
6
+ require ( './app-webpack' )
7
+ const { hydrate } = require ( './app-index' )
4
8
// Include app-router and layout-router in the main chunk
5
9
require ( 'next/dist/client/components/app-router' )
6
10
require ( 'next/dist/client/components/layout-router' )
7
- require ( './app-webpack' )
8
- const { hydrate } = require ( './app-index' )
9
11
hydrate ( )
10
12
} )
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export function useFlightResponse(
26
26
}
27
27
// react-server-dom-webpack/client.edge must not be hoisted for require cache clearing to work correctly
28
28
let createFromReadableStream
29
+ // @TODO : investigate why the aliasing for turbopack doesn't pick this up, requiring this runtime check
29
30
if ( process . env . TURBOPACK ) {
30
31
createFromReadableStream =
31
32
// eslint-disable-next-line import/no-extraneous-dependencies
You can’t perform that action at this time.
0 commit comments