-
Notifications
You must be signed in to change notification settings - Fork 482
"IDBIndex is not defined" after updating from 13.03 → v13.10 (pre-rendering) #2475
Comments
I have been trying to find a solution for this for about 5 days now. I tried downgrading to 13.0.3 but still, get the error. If I remove angular/fire for authentication it is resolved. Extremely frustrating. |
Please check your package-lock.json if your angular version is the version you downgraded to? I sometimes find that the package.json version is different from package-lock.json version and this causes the issue. The only solution i found was to manually uninstall all the angular packages (npm uninstall @angular/core.....) and then manually installing them again with the desired version (npm install --save @angular/[email protected] ......) |
@mazlano27 you just saved my life on this. You were right. lock file had 3.1. Removed and manually added back 3.0.x and now dev:ssr is working! |
I've been stuck on this for days. That saved my ass. Thanks |
I'm running into this error too when running Universal. Any solutions? It seems to be firebase related. See also this issue. I don't understand how upgrading from 13.0 to 13.1 is causing this tho, nor how I could apply the suggested workaround in an Angular app. This is my diff after I ran |
I ran into this issue when upgrading from 12 to 13.1. My project was not using a custom webpack file, but creating a webpack config file as documented (from 2018...) here solved my problem: https://github.com/angular/angularfire/blob/master/docs/universal/getting-started.md#3-add-a-webpack-config-for-the-express-server |
Thank you for sharing. I tried to create the webpack config file but realised it was for SSR (and not pre-rendering). I tried it still and it does not seem to work for pre-rendering. I tried to add the firebase packages as external dependencies in the angular.json file too - that didn't help either :/ |
@kgajera thank you for your insight - based on some experimentation, I managed to find the fix! :) Solution: Create a custom webpack file which excludes firebase from the server bundle. Steps:
References:
|
Why is this suddenly necessary? Everything works fine with NG 13.0. I don't really like having to add a custom webpack config |
This sounds like something very much not an issue with Angular Universal. Can anyone point to something specific in Universal that shows the problem? If it's just a problem with Angular Fire, solved using the workaround they published, then we can either close this, or repurpose this to add docs for how to handle this edge case in the README. |
@CaerusKaru I'm not sure where this issue arises. It started after the 13.1 update - and I'm unable to point to something specific in Universal that shows the problem. Rolling back to 13.0 resolved the issue. I think it's useful to document (as an edge case) how we might be able to exclude certain libraries from the universal build pipeline incase these libraries cause errors in the server side node environment? |
Has anyone found a solution? I'am stuck at it and I really don't want to add custom webpack config |
Hello all seems that I'm facing the same problem, and has I have read the most direct solution is to downgrade Angular do 13.03 . |
I was able to temporarily use mazlano27's solution. It's working and I don't need to downgrade but keep in mind that you would have to reverse this 'fix' in the future. |
I also have this problem for 2 days. I just found this issue and saw that it's not just me.
|
I created this empty project to simulate the problem and show that it's not an error in the code I made. I just followed the following steps:
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
|
Downgrading (from 17/16) to Node ^14 helped me. |
I have tried downgrading to 13.0.3 but it still throws the same error. Any solutions yet? |
I am facing same issue ReferenceError: IDBIndex is not defined after I upgrade the Angular version from 12.0.1 to 13.1.3. after I use 'node dist/localmasters/server/main.js' I get below error.
Downgrading to 13.0.3 does helped to stay in Angular 13. package.json
|
Delete these
Update version manually for angular and material. Try matching this package.json package.json
And run It should work for version 13.0.3 |
I am getting any idea how to fix this. |
then @Santoshah I believe that it may be some incompatibility between the modules and even if you have removed the firebase from the webpack it is necessary... so it is giving an error... taking firebase completely out of the bundle I don't think it's the ideal solution. must have some firebase method that angular universal, for being ssr, is not able to execute. the ideal would be someone from the core of one of the modules to at least open our eyes to what could be. |
AngularFire maintainer here, the root cause appears to be Firebase JS SDK's usage of the |
Are there any plans to correct this? |
IMO this can be closed now that root cause has been identified as Firebase JS SDK, move conversation there. |
@jmarlow4 I opened an issue on that repo, I can only say that the team has been made aware. There are plans that would address the root cause at some point, hoping we can prioritize at least a short term fix. |
Hi there, your solution fix the "IDBIndex is not defined" error, but throws the following error: I assume this fix wont work with Angular SSR? Thanks EDIT: fix for my last image, dont use ANYTHING related to firebase in app.component.ts (don't inject services that use firebase either), if you do that, the app will serve:ssr and work everything fine. I had to lazyload my modules which are using firebase, and move some logic which was firebase related to such modules. Now my app is serving in SSR mode just fine. I hope in the future they fix this. So to summarise: do @kgajera solution, and if you encounter the same problem as me, try my solution on top of that. I'm using Angular 13.2.6 |
Downgrading still the best solution ? |
I really do not know. I can't do regression due to technical requirements of some dependencies. so i'm waiting for the proper solution. The issue has already been opened in the appropriate project and I believe they are already looking: |
Our team has all the latest versions of NX and NG (13.2) we were able to get rid of this problem by downgrading one package.
|
This does the job. |
This does not work in my case, would you share your full package.json? |
here is my package.json. I also got error regarding some version mismatch. For that I had to add browser names statically in my package.json to work. After this I was able to run SSR build and SSR serve with no issue.
|
Are you still facing issue ? They said they had release the fixed on Firebase version 9.6.9. I am using firebase 8 so not able to make it work so far. Aren't you able to build and run the app ? |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
Yes
Description
After upgrading to angular 13.10 from 13.03, pre-rending the app fails with the "IDBIndex is not defined" error.
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
Reverting back to 13.03 resolves this error.
The text was updated successfully, but these errors were encountered: