Comments (3)
This issue can be closed
@niklv This occurs because your plugin attempts to initialize firebase in server side, where as it should only occur in browser.
Your firebase plugin needs to be changed to a client-only plugin.
nuxt.config.ts
import { defineNuxtConfig } from "nuxt3";
export default defineNuxtConfig({
publicRuntimeConfig: {
firebaseConfig: {},
},
});
plugins/firebase.client.ts
: this is a working code snippet from my personal project
import { getApps, initializeApp } from "firebase/app";
import { getAuth, setPersistence, inMemoryPersistence } from "firebase/auth";
export default defineNuxtPlugin(() => {
try {
if (getApps().length === 0) {
const { firebaseConfig } = useRuntimeConfig();
if (firebaseConfig) initializeApp(firebaseConfig);
}
const auth = getAuth();
if (auth) setPersistence(auth, inMemoryPersistence);
} catch (e) {
console.error(e);
}
});
also, with firebase v9. I think it's very pointless to provide / inject anything from firebase
from framework.
@Diizzayy I what to use firebase-js-sdk in ssr to. So i what to initialize in server and client plugin. (And I named it firebase.ts
especially).
Answer not covered issue that is initialize ok in production build and no initialized in development build.
@danielroe please reopen
from framework.
I'll convert this to a discussion 👍
from framework.
Related Issues (20)
- how to use obfuscator on nuxt3
- Accessibility of API return
- Migration to `nuxt/nuxt` HOT 1
- Dependency Dashboard
- [FEATURE REQUEST] Preview mode for Nuxt 3 HOT 1
- ContentResolver fails when using nuxt rc12 or newer HOT 1
- onResponseError
- about middleware and logs collection HOT 1
- Place of the nitro server in Techempower Web Framework Benchmarks HOT 1
- Postcss with Nuxt 3.0.0 HOT 1
- Never use browser cache in https access
- Playwright chromioum works in dev but fails on production
- How to get access localStorage Nuxt.config.ts version 3?
- How can i get the response headers on the client side? HOT 1
- How to add a cache policy HOT 1
- Help: How to use App.vue and wait for store to be ready through the app
- HMR won't connect behind reverse proxy with Firefox HOT 2
- Windows-IIS-Server
- vite watch is not working in node_modules directory. HOT 1
- Server directory documentation about SSR requests and performance with nuxt
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from framework.