#Implementing push notifications with Convex using Firebase SDK

6 messages · Page 1 of 1 (latest)

cosmic hollow
#

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

stuck emberBOT
#

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](https://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!
safe flint
#

Are you importing anything from that file to any other files?

cosmic hollow
#

This is the utility file firebase.ts

Then i import the utility function here inside topicSubscription, then i use the utility function inside InternalAction

safe flint
#

Gotcha - so topicSubscription would also need to use node for this to work

cosmic hollow
#

ohh, ok, ill try one sec