From e98469df0a90db09df56701ef2c2bd267026a9be Mon Sep 17 00:00:00 2001 From: yuangwang Date: Tue, 19 Nov 2024 12:16:07 -0600 Subject: [PATCH 1/2] Change FAH preset to use relative runCommand --- src/presets/firebase/preset.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/presets/firebase/preset.ts b/src/presets/firebase/preset.ts index c741d71435..d52a325382 100644 --- a/src/presets/firebase/preset.ts +++ b/src/presets/firebase/preset.ts @@ -88,7 +88,7 @@ const firebaseAppHosting = defineNitroPreset( stringifyYAML({ version: "v1", runConfig: { - runCommand: "node .output/server/index.mjs", + runCommand: `node ${join(nitro.options.output.serverDir, "index.mjs")}`, ...(nitro.options.firebase as AppHostingOptions)?.appHosting, }, metadata: { From 19c674a09485cf9d8e241fd5fd78b45c4b148b7e Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 19 Nov 2024 20:00:05 +0100 Subject: [PATCH 2/2] use relative path --- src/presets/firebase/preset.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/presets/firebase/preset.ts b/src/presets/firebase/preset.ts index d52a325382..a7098a248e 100644 --- a/src/presets/firebase/preset.ts +++ b/src/presets/firebase/preset.ts @@ -1,6 +1,6 @@ import { defineNitroPreset, writeFile } from "nitropack/kit"; import { version as nitroVersion } from "nitropack/meta"; -import { basename, join } from "pathe"; +import { basename, join, relative } from "pathe"; import type { Plugin } from "rollup"; import { genSafeVariableName } from "knitwork"; import { stringifyYAML } from "confbox"; @@ -83,12 +83,13 @@ const firebaseAppHosting = defineNitroPreset( serveStatic: true, hooks: { async compiled(nitro) { + const serverEntry = join(nitro.options.output.serverDir, "index.mjs"); await writeFile( join(nitro.options.rootDir, ".apphosting/bundle.yaml"), stringifyYAML({ version: "v1", runConfig: { - runCommand: `node ${join(nitro.options.output.serverDir, "index.mjs")}`, + runCommand: `node ${relative(nitro.options.rootDir, serverEntry)}`, ...(nitro.options.firebase as AppHostingOptions)?.appHosting, }, metadata: {