We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 395ed96 commit e68977bCopy full SHA for e68977b
packages/nuxt/src/module/emulators.ts
@@ -1,4 +1,4 @@
1
-import { readFile, stat } from 'node:fs/promises'
+import { readFile, stat, access, constants } from 'node:fs/promises'
2
import stripJsonComments from 'strip-json-comments'
3
import type { ConsolaInstance } from 'consola'
4
import type { VueFireNuxtModuleOptions } from './options'
@@ -18,6 +18,11 @@ export async function willUseEmulators(
18
return null
19
}
20
21
+ // return true if the file doesn't exist instead of throwing
22
+ if (await access(firebaseJsonPath, constants.F_OK).catch(() => true)) {
23
+ return null
24
+ }
25
+
26
const fileStats = await stat(firebaseJsonPath)
27
if (!fileStats.isFile()) {
28
0 commit comments