File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -42,9 +42,9 @@ export default defineNuxtConfig({
4242 } ,
4343
4444 admin : {
45- serviceAccount : resolve (
46- fileURLToPath ( new URL ( './service-account.json' , import . meta. url ) )
47- ) ,
45+ // serviceAccount: resolve(
46+ // fileURLToPath(new URL('./service-account.json', import.meta.url))
47+ // ),
4848 } ,
4949 } ,
5050 ] ,
Original file line number Diff line number Diff line change 88 createResolver ,
99 defineNuxtModule ,
1010} from '@nuxt/kit'
11- import type { NuxtModule } from '@nuxt/schema'
1211// cannot import from firebase/app because the build fails, maybe a nuxt bug?
1312import type { FirebaseApp , FirebaseOptions } from '@firebase/app-types'
1413import type {
@@ -114,6 +113,18 @@ export default defineNuxtModule<VueFireNuxtModuleOptions>({
114113 typeof process . env . GOOGLE_APPLICATION_CREDENTIALS === 'string' &&
115114 process . env . GOOGLE_APPLICATION_CREDENTIALS . length > 0
116115
116+ // resolve the credentials in case of monorepos and other projects started from a different folder
117+ if (
118+ typeof process . env . GOOGLE_APPLICATION_CREDENTIALS === 'string' &&
119+ process . env . GOOGLE_APPLICATION_CREDENTIALS ?. [ 0 ] !== '{'
120+ ) {
121+ const resolvedCredentials = resolve (
122+ nuxt . options . rootDir ,
123+ process . env . GOOGLE_APPLICATION_CREDENTIALS
124+ )
125+ process . env . GOOGLE_APPLICATION_CREDENTIALS = resolvedCredentials
126+ }
127+
117128 // NOTE: the order of the plugins is reversed, so we end by adding the app plugin which is used by all other
118129 // plugins
119130
You can’t perform that action at this time.
0 commit comments