question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Angular Universal with Angular Fire is breaking - IDBIndex is not defined

See original GitHub issue

I have a project i am trying to implement ssr with universal angular. but I’m not getting it. I thought it was a problem in my code until I started a project from scratch to test and found something was wrong.

**ReferenceError: IDBIndex is not defined**

I commented on this open issue in the angular universal repository

Version info

Angular CLI: 13.1.2
Node: 16.13.1
Package Manager: npm 8.1.2
OS: linux x64

Angular: 13.1.1
... animations, cdk, common, compiler, compiler-cli, core, forms
... material, platform-browser, platform-browser-dynamic
... platform-server, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1301.2
@angular-devkit/build-angular   13.1.2
@angular-devkit/core            13.1.2
@angular-devkit/schematics      13.1.2
@angular/cli                    13.1.2
@angular/fire                   7.2.0
@nguniversal/builders           13.0.1
@nguniversal/express-engine     13.0.1
@schematics/angular             13.1.2
rxjs                            7.4.0
typescript                      4.5.4

How to reproduce these conditions

I created this empty project to simulate the problem and show that it’s not an error in the code I made. https://github.com/miguelsmuller/teste-project

I just followed the following steps:

  • ng new teste-project
  • ng add @angular/material
  • ng add @ngrx/store
  • ng add @ngrx/effects
  • ng add @nguniversal/express-engine
  • ng add @angular/fire

each command above is a commit from that test project

the last command (ng add @angular/fire) returned as shown in the image below. The informed parameters are also shown in the image.

Screenshot 2022-01-07 090417

and finally the error that is displayed when I run the command npm run build:ssr && npm run serve:ssr - image below in the right column. You can also see in this image on the left that when I run npm run start as csr no error is displayed.

Screenshot 2022-01-07 090956

Debug output

ReferenceError: IDBIndex is not defined
    at /home/migue/FromLinux/projects/teste-project/dist/teste-project/server/main.js:1:4322339
    at /home/migue/FromLinux/projects/teste-project/dist/teste-project/server/main.js:1:4644564
    at Object.<anonymous> (/home/migue/FromLinux/projects/teste-project/dist/teste-project/server/main.js:1:4644796)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47

Expected behavior

I believe the expected is node running the app listening on port 4000

Actual behavior

The compilation process is going on but probably with some error because the npm run build:ssr is finished but the npm run serve:ssr is not terminated, it just displays the entire contents of the bundle on the console and then the ReferenceError: IDBIndex is not defined error appears

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:21 (6 by maintainers)

github_iconTop GitHub Comments

7reactions
miguelsmullercommented, Feb 2, 2022

@all do you have any news other than downgrading?

2reactions
miguelsmullercommented, Feb 28, 2022

I do not know. but it seems to me that the maintainers will not give a damn about this situation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReferenceError: IDBIndex is not defined in angular universal ...
I use "@angular/fire": "^5.2.0-beta.3", instead of "angularfire2": "^5.1.0" I am facing the same issue, after implementing ...
Read more >
Angular Universal: Complete Practical Guide
This post will be a complete practical guide for getting started with Angular Universal. We are going to go start with an existing...
Read more >
angular/angularfire2 - Gitter
now i am trying to use firebase and when adding it with "ng add @angular/fire" i get this error: architect_1.createBuilder is not a...
Read more >
AngularFire - @angular/fire - npm
Compatibility. Angular and Firebase versions. AngularFire doesn't follow Angular's versioning as Firebase also has breaking changes throughout ...
Read more >
Release Notes | Firebase - Google
This version (v11.0.0) of the Firebase CLI contains breaking changes. Breaking: Drops support for ... Fix for "IDBIndex is not defined runtime exception"...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found