when i try use the import in serviceworker.js file i am getting errors.
- i have create a seperate service worker file and registered and when i try to use the below code
import { initializeApp } from "firebase/app"; import { getAnalytics } from "firebase/analytics"; import { getFirestore, collection, addDoc, setDoc, doc, from "firebase/firestore";
i am getting a error
Uncaught DOMException: Failed to execute ‘import’ on ‘WorkerGlobalScope’:
i have also installed angular/pwa and tried to import them in the ngsw-worker.js still i got the same issue
i am not able to understand how to achieve the requirement.
Harish reddyshetty is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.