Skip to content

Commit 605aef0

Browse files
committed
Restore previous server manifest structure for Turbopack for now
1 parent 33c511f commit 605aef0

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

packages/next/src/build/webpack/plugins/flight-client-entry-plugin.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ const PLUGIN_NAME = 'FlightClientEntryPlugin'
5555
type Actions = {
5656
[actionId: string]: {
5757
workers: {
58-
[name: string]: { moduleId: string | number; async: boolean }
58+
[name: string]:
59+
| { moduleId: string | number; async: boolean }
60+
// TODO: This is legacy for Turbopack, and needs to be changed to the
61+
// object above.
62+
| string
5963
}
6064
// Record which layer the action is in (rsc or sc_action), in the specific entry.
6165
layer: {

packages/next/src/server/app-render/action-utils.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,17 @@ export function createServerModuleMap({
1818
{},
1919
{
2020
get: (_, id: string) => {
21-
const { moduleId, async } =
21+
const workerEntry =
2222
serverActionsManifest[
2323
process.env.NEXT_RUNTIME === 'edge' ? 'edge' : 'node'
2424
][id].workers[normalizeWorkerPageName(pageName)]
2525

26+
if (typeof workerEntry === 'string') {
27+
return { id: workerEntry, name: id, chunks: [] }
28+
}
29+
30+
const { moduleId, async } = workerEntry
31+
2632
return { id: moduleId, name: id, chunks: [], async }
2733
},
2834
}

0 commit comments

Comments
 (0)