-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular Universal with Angular Fire is breaking - IDBIndex is not defined #3113
Comments
This issue does not seem to follow the issue template. Make sure you provide all the required information. |
Downgrading (from 17/16) to Node ^14 helped me. |
Hey @rossanmol.... I've tried with the node versions below (10, 12, 14, 16 and 17). All gave the same error with the exception of nde in v10 because the cli command is not compatible.
|
Same error
Angular SSR 13 |
I think this is right platform to post instead of angular universal. I am getting I believe this is due to excluding of fire base from webpack. But again installing firebase and excluding it during bundle generation don't make sense either. Do we have other solutions? |
@ALL do you have any news other than downgrading? |
@ALL any solutions yet ? |
Only working workaround for now: angular/universal#2475 (comment) |
Any update on this? Seems like this issue has been lurking around for a long time now. |
This comment was marked as abuse.
This comment was marked as abuse.
We've been looking into this, it's not a problem with AngularFire though; it seems to be a problem with a dependency of Firebase JS SDK, idb, now that Angular Universal is targeting modules in Node.js. |
@miguelsmuller please keep it respectful, we have a lot of other duties and are doing our best to stay on top of stuff but sometimes things like this slip through. This library is at the intersection of many of dependencies & any violation of semver can put us in a painful spot. |
@jamesdaniels can you point out where exactly to look into so that I can start debugging and try to figure out where the issue lies? I have no experience with firebase in general hence getting a grasp on this is a bit overwhelming. I have been looking into how to setup firebase with angular hoping that the angularfire library follows something similar, but if you at least point to the right direction, I hope I can be of some help too! |
@onclave I'd just lag behind Angular a little bit if I were you until all this settles down. It's likely that you'll run into similar problems in libraries beyond Firebase. In the prior state of affairs you could count on Node only loading the CJS, naively that's how package authors differentiated Node from browser bundles—now that the Universal builds go for ESM (I think this was introduced in Angular 13.1?) it can lead to surprises. Ultimately the root cause is that the version of |
The custom webpack solution here angular/universal#2475 (comment) is also a reasonable solution for the time being. |
If this is a problem occuring due to removal of IE then can we add reuqest for ie support in Angular 13.1 + ? Maybe we add in .browserlist or update package.json do you think it will fix that issue.. updating package.json like this. (not experimented)
|
@jamesdaniels I apologize for the previous comment. I didn't mean to be rude. |
@Santoshah no, that's just the root cause for why Firebase JS SDK can't upgrade it's |
Filed as an issue over there, I'm going to close this issue but pin it; we can of course continue to discuss. |
@jamesdaniels firebase-js-sdk has been updated from 9.6.6 -> 9.6.9 and according to your issue the solution is already live. is there anything i can do to help solve what we have here in angularfire right now. If you need anything, I'm at your disposal. |
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
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.
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 runnpm run start
as csr no error is displayed.Debug output
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 thenpm run serve:ssr
is not terminated, it just displays the entire contents of the bundle on the console and then theReferenceError: IDBIndex is not defined
error appearsThe text was updated successfully, but these errors were encountered: