nuxt-community / firebase-module

๐Ÿ”ฅ Easily integrate Firebase into your Nuxt project. ๐Ÿ”ฅ
https://firebase.nuxtjs.org
MIT License
641 stars 99 forks source link

Cannot read property 'config' of undefined (dupe of #493) #555

Open Benjamin-Lee opened 3 years ago

Benjamin-Lee commented 3 years ago

I am making a new issue to track #493's problem, which I think was closed prematurely. Using the terminateDatabasesAfterGenerate option raises an error.

Version

@nuxtjs/firebase: 7.6.1 firebase: 8.6.8 nuxt: 2.15.3

Reproduction Link

See #493

Steps to reproduce

Use terminateDatabasesAfterGenerate: true

What is Expected?

The generation succeeds

What is actually happening?

โ„น Full static generation activated                                                          07:45:16

 FATAL  Cannot read property 'config' of undefined                                          07:45:16

  at node_modules/@nuxtjs/firebase/lib/module.js:334:57
  at runMicrotasks (<anonymous>)
  at processTicksAndRejections (node:internal/process/task_queues:96:5)
  at async Nuxt.callHook (node_modules/hable/dist/hable.js:1:959)
  at async Generator.initiate (node_modules/@nuxt/generator/dist/generator.js:102:5)
  at async Generator.generate (node_modules/@nuxt/generator/dist/generator.js:71:5)
  at async generate$1 (node_modules/@nuxt/cli/dist/cli-generate.js:46:22)
  at async Object.run (node_modules/@nuxt/cli/dist/cli-generate.js:284:7)
  at async NuxtCommand.run (node_modules/@nuxt/cli/dist/cli-index.js:413:7)

   โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
   โ”‚                                                           โ”‚
   โ”‚   โœ– Nuxt Fatal Error                                      โ”‚
   โ”‚                                                           โ”‚
   โ”‚   TypeError: Cannot read property 'config' of undefined   โ”‚
   โ”‚                                                           โ”‚
   โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
simeon9696 commented 3 years ago

I think you should include that property only if you were getting the below error:

โš  Nuxt Warning 

The command 'nuxt generate' finished but did not exit after 5s
This is most likely not caused by a bug in Nuxt.js
Make sure to cleanup all timers and listeners you or your plugins/modules start.
Nuxt.js will now force exit

DeprecationWarning: Starting with Nuxt version 3 this will be a fatal error  

If you didn't get that in the first place, maybe you could try removing the property?

Benjamin-Lee commented 3 years ago

To clarify, I was getting that error (using Nuxt Firebase plugin) with static generation