1

I have tried to use Firebase cloud messaging with next.js

Server Error
ReferenceError: self is not defined

I am having above error while running my next.js app

This is my code

import 'firebase/messaging';
import firebase from 'firebase/app'
const firebaseConfig = {
//passed correct data
}
export const auth = firebase.auth();
export const firestore = firebase.firestore();
export const storage = firebase.storage();
export const messaging = firebase.messaging();
  • 2
    duplicate of https://stackoverflow.com/questions/66096260/webpack-why-am-i-getting-referenceerror-self-is-not-defined-in-next-js-when-i – Hagai Harari May 26 '21 at 08:06

0 Answers0