I got stuck in this issue an entire day, I have NodeJS web chat app and using firebase for notifications the problem is I couldn't import neither firebase App module nor firebase messaging module from node_modules
import * as messaging from "../../../../node_modules/@firebase/messaging/dist/index.cjs.js";
and it gives me the following error
index.cjs.js:3 Uncaught ReferenceError: exports is not defined
at index.cjs.js:3:23
may be the file that i am importing is the wrong one , if there is another file that i had to import from node_modules/@firebase please let me know
another problem when i used cdn
import * as messaging from "https://cdnjs.cloudflare.com/ajax/libs/firebase/7.14.1-0/firebase-messaging.js"
i've got the following error
TypeError: Cannot read properties of undefined (reading 'INTERNAL')
at index.ts:41:12
at index.ts:75:21
at firebase-messaging.js:1:163
at firebase-messaging.js:1:187
thanks in advance