vuejs/vuefire

Nuxt error page with layout throws vague error `_ctx.$myPluginMethod is not a function`

Closed this issue · 2 comments

Reproduction

https://github.com/BobbieGoede/nuxt-vuefire-error-page

Steps to reproduce the bug

  1. pnpm i (should create .env and service-account.json for repro automatically)
  2. pnpm dev
  3. Open localhost:3000, it should show the error _ctx.$myPluginMethod is not a function
  4. Refreshing the page again will show the actual error (0 , __vite_ssr_import_0__.getApps) is not a function (unclear why refreshing does this)

Expected behavior

The actual error thrown by vuefire should be shown

Actual behavior

I assume the error in vuefire is preventing other plugins from providing their methods on the context, which is why the confusing error is shown.

Additional information

The actual error thrown is described in #1627

I investigated this due to nuxt-modules/i18n#3755

This is probably a nuxt issue, if a plugin throws an error then plugins that follow are skipped and will not run their setup function.

This might be resolved upstream with nuxt/nuxt#32744, closing since it is only indirectly caused by this module.