Git Product home page Git Product logo

nuxt3_firebase9_ssr_bug's Introduction

Nuxt 3 + Firebase 9 bug

Setup

Make sure to install the dependencies and provide firebase creadentials

npm install

Development

Start the development server on http://localhost:3000

npx nuxi dev

Production

Build the application for production:

npx nuxi build && npx nuxi preview

Bug description

npx nuxi dev

Open http://localhost:3000. In server console you will receive error:

Component auth has not been registered yet
  at Provider.initialize (file://./.nuxt/dist/server/server.mjs:2647:19)  
  at initializeAuth (file://./node_modules/@firebase/auth/dist/node-esm/index-2bbaab7c.js:584:27)  
  at Module.getAuth (file://./node_modules/@firebase/auth/dist/node-esm/index-2bbaab7c.js:5985:12)  
  at file://./.nuxt/dist/server/server.mjs:1728:38  
  at callWithNuxt (file://./.nuxt/dist/server/server.mjs:254:20)  
  at applyPlugin (file://./.nuxt/dist/server/server.mjs:205:29)  
  at Module.applyPlugins (file://./.nuxt/dist/server/server.mjs:215:11)  
  at async createNuxtAppServer (file://./.nuxt/dist/server/server.mjs:51:5)  
  at async renderToString (file://./node_modules/vue-bundle-renderer/dist/index.mjs:247:19)  
  at async renderMiddleware (file://./.nuxt/nitro/index.mjs:206:20)

Stop server. And run production build:

npx nuxi build && npx nuxi preview

Open http://localhost:3000. There are no error in server console. And auth module is initialized as normal.

Summarize

In total, we have that nuxt dev mode and prod mode handles differenly firebase-js-sdk in SSR.

nuxt3_firebase9_ssr_bug's People

Contributors

niklv avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.