diff --git a/.changeset/cyan-timers-cover.md b/.changeset/cyan-timers-cover.md new file mode 100644 index 00000000..42af5426 --- /dev/null +++ b/.changeset/cyan-timers-cover.md @@ -0,0 +1,7 @@ +--- +"@vinxi/server-components": patch +"@vinxi/server-functions": patch +"vinxi": patch +--- + +fix: await plugins in server functions/comoponents overrides diff --git a/packages/vinxi-server-components/index.js b/packages/vinxi-server-components/index.js index 4fe996c5..67bc402a 100644 --- a/packages/vinxi-server-components/index.js +++ b/packages/vinxi-server-components/index.js @@ -15,6 +15,6 @@ export const serverComponents = { handler: fileURLToPath(new URL("./server-handler.js", import.meta.url)), target: "server", ...(overrides ?? {}), - plugins: () => [server(), ...(overrides?.plugins?.() ?? [])], + plugins: async () => [server(), ...((await overrides?.plugins?.()) ?? [])], }), }; diff --git a/packages/vinxi-server-components/plugin.js b/packages/vinxi-server-components/plugin.js index 4fe996c5..67bc402a 100644 --- a/packages/vinxi-server-components/plugin.js +++ b/packages/vinxi-server-components/plugin.js @@ -15,6 +15,6 @@ export const serverComponents = { handler: fileURLToPath(new URL("./server-handler.js", import.meta.url)), target: "server", ...(overrides ?? {}), - plugins: () => [server(), ...(overrides?.plugins?.() ?? [])], + plugins: async () => [server(), ...((await overrides?.plugins?.()) ?? [])], }), }; diff --git a/packages/vinxi-server-functions/plugin.js b/packages/vinxi-server-functions/plugin.js index 6e6fa94d..7be1edbe 100644 --- a/packages/vinxi-server-functions/plugin.js +++ b/packages/vinxi-server-functions/plugin.js @@ -25,6 +25,9 @@ export const serverFunctions = { handler: fileURLToPath(new URL("./server-handler.js", import.meta.url)), target: "server", ...(overrides ?? {}), - plugins: () => [server({ runtime }), ...(overrides?.plugins?.() ?? [])], + plugins: async () => [ + server({ runtime }), + ...((await overrides?.plugins?.()) ?? []), + ], }), };