Kilworth
Kilworth2w ago

Implementing push notifications with Convex using Firebase SDK

I know that the Node runtime is only available in actions, but when I try to import the Firebase SDK, I get several errors like this one: ✘ [ERROR] Could not resolve "stream" node_modules/@google-cloud/firestore/build/src/reference/query-util.js:19:25: 19 │ const stream_1 = require("stream"); ╵ ~~~~ The package "stream" wasn't found on the file system but is built into Node. Are you trying to bundle for Node? You can use "platform: 'node'" to do that, which will remove this error. Any ideas on how to fix this? I already tried use node directive at the top of the file Thanks
5 Replies
Convex Bot
Convex Bot2w ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
erquhart
erquhart2w ago
Are you importing anything from that file to any other files?
Kilworth
KilworthOP2w ago
This is the utility file firebase.ts Then i import the utility function here inside topicSubscription, then i use the utility function inside InternalAction
No description
No description
erquhart
erquhart2w ago
Gotcha - so topicSubscription would also need to use node for this to work
Kilworth
KilworthOP2w ago
ohh, ok, ill try one sec Perfect, thanks too much

Did you find this page helpful?