[Flight] Support Async Modules in Turbopack Server References (#34531)
Seems like this was missed in https://github.com/facebook/react/pull/31313
Janka Uryga committed
Sep 19, 2025 at 21:12 UTC
01cad9eacac1e1559b06076239793304845b415c
1 file changed
+13
-1
packages/react-server-dom-turbopack/src/client/ReactFlightClientConfigBundlerTurbopack.js
+13
-1
@@ -132,7 +132,19 @@ export function resolveServerReference<T>(
132
);
133
}
134
}
135
- // TODO: This needs to return async: true if it's an async module.
135
+ if (resolvedModuleData.async) {
136
+ // If the module is marked as async in a Client Reference, we don't actually care.
137
+ // What matters is whether the consumer wants to unwrap it or not.
138
+ // For Server References, it is different because the consumer is completely internal
139
+ // to the bundler. So instead of passing it to each reference we can mark it in the
140
+ // manifest.
141
+ return [
142
+ resolvedModuleData.id,
143
+ resolvedModuleData.chunks,
144
+ name,
145
+ 1 /* async */,
146
+ ];
147
+ }
148
return [resolvedModuleData.id, resolvedModuleData.chunks, name];
149
}
150