Troubleshooting FCM Messaging Issues in an SSR Environment

27 views Asked by At

I am currently using an SSR (Server-Side Rendering) framework called Electrode JS for my application. The frontend is built with React, while the backend is running on Node.js v16. I use Fastify on the backend to serve firebase-messaging-sw.js as a static file to the client. Although I can successfully retrieve the FCM token, I am facing issues in receiving test messages sent from the FCM portal. The messages are sent but not received on my end. Does FCM not support SSR environments?

I have tried different versions of Firebase (10, 9, 8) and React (18, 17, 16) to resolve this issue. Currently, I am testing this on localhost. Is it possible that FCM messages cannot be received on localhost?

In a standard SPA setup, I receive messages without any issues, but in an SSR environment, the messages are not getting through. Could you please assist me with this issue?

0

There are 0 answers