closed in withastro/astro#1263 after migration from snowpack to vitejs
This repo is a reproduction of a bug when using Firebase JS SDK (v9) with astro
- Clone this repo
npm i
npm run start
-
npm init astro
. Choose skeleton with Svelte.js as the framework. -
npm i
-
npm i firebase
-
Import Firebase in
src/components/svelteCounter.svelte
+import { initializeApp, getApps } from "firebase/app"; +import { getFirestore, doc, onSnapshot, setDoc } from "firebase/firestore"; let count = 0;
-
npm run start
-
Error is shown in browser console and Counter does not work.
Loading failed for the module with source “node:process”. Uncaught (in promise) TypeError: error loading dynamically imported module Loading failed for the module with source “http://localhost:3000/_snowpack/pkg/@firebase.webchannel-wrapper.v0.5.1.js”.
This error is specific to importing Firestore as the app works when import { ... } from "firebase/firestore";
is commented out.