-
Notifications
You must be signed in to change notification settings - Fork 932
Server side rendering: ReferenceError: IDBIndex is not defined #2530
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
Comments
I found a few problems with this issue:
|
Messaging actually is not supported in Node (see supported environments table). Can you set up a different entry point for your server rendering bundle that doesn't import it? |
@hsubox76 Ok, I solved this problem with dynamic imports: import('firebase/messaging').then(() => { ... }); |
Glad to hear that you found a workaround, @zd-dalibor. I am going to close this issue. If you're still experiencing this problem and want to continue the discussion, just leave a comment here and we are happy to re-open this. |
FYI looks like this is the same as #6042. One major issue with the work around, dynamic imports break tree-shaking. Which is why it's not something we should be advising. |
Also we need to figure out a way to ensure that just including the module, even if it's not supported, does not lead to the developer's entire bundle being broken; as isomorphic code is becoming more commonplace. For the Googlers in the thread, check out this doc for a deeper explanation for the issues at hand. |
I'm trying to make the serverside rendering bundle with webpack. And my application using messages sdk:
My bundle must be self-contained (do not load node module at runtime - everything should be inside bundle).
I'm trying to solve my problem with suggestions from this #1797 using something like this in webconfg to force loading node compatible scripts:
but the problem is in this module
@firebase/installations
, both browser and node version have reference onidb
module (https://www.npmjs.com/package/idb) with code:So I do not know how to get rid of this.
I em using firebase 7.6.2 version.
The text was updated successfully, but these errors were encountered: