Attempting to build my Angular application using the command npm run build:ssr
. The application built successfully, but when running the command npm run serve:ssr
, I encounter the following error:
ReferenceError: IDBIndex is not defined
Note: Upon investigation, it seems that the issue lies with the Firebase package I am using. I have wrapped the entire content in a check like this
if (isPlatformBrowser(this.platform)) {}
but the error persists.
The problem may be stemming from this line of import:
import { openDb, deleteDb } from 'idb';
Could someone assist me? Do I need to dynamically import idb
?
Note: I have already referred to this answer, but it has not resolved the issue for me.