ReferenceError: IDBIndex is not defined in angular universal app

后端 未结 2 405
别跟我提以往
别跟我提以往 2021-01-15 19:42

I was running the application using \"ng serve\" it was working fine. But after I built the app using \"npm run build:ssr\", The app got built successfully.

After bu

相关标签:
2条回答
  • 2021-01-15 20:34

    I use "@angular/fire": "^5.2.0-beta.3", instead of "angularfire2": "^5.1.0" I am facing the same issue, after implementing "AngularFirePerformanceModule", I removed it; import { AngularFirePerformanceModule } from '@angular/fire/performance'; and the issue went away.

    0 讨论(0)
  • 2021-01-15 20:41

    if you still want to use the angulare/fire/performance module, in your app.module.ts, you could do this.

    import { isPlatformBrowser } from '@angular/common';
    import { AppComponent } from './app.component';
    
    const importModuleArray: any[] = [ // your modules here ]
    
    if (isPlatformBrowser) {
      require('@angular/fire/performance').then(module => {
        importModuleArray.push(module.AngularFirePerformanceModule);
      });}
    
    @NgModule({
      **your declarated modules as AppComponent for example**
      ],
      imports: importModuleArray
      bootstrap: [AppComponent]
    })
    
    0 讨论(0)
提交回复
热议问题