Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

332
Visualizações
importing firebase app & messaging modules without bundling

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

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda