Skip to content
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

Cloudflare compatibility issue when trying to get Solana stream client - typescript/nodejs #243

Open
strahinja-gojkovic opened this issue Dec 18, 2024 · 0 comments

Comments

@strahinja-gojkovic
Copy link

It seems that when I make a stream client on my Cloudflare worker, it crashes.
My code for worker to test out the stream initialization:

import { StreamflowSolana } from "@streamflow/stream"

export const onRequestGet: PagesFunction<any> = async () => {
    try {
        const stream = new StreamflowSolana.SolanaStreamClient('https://api.devnet.solana.com')
        return new Response()
    } catch (e) {
        return new Response()
    }
}

Error:
**✘ [ERROR] service core:user:worker: Uncaught TypeError: (init_inherits(...) , __toCommonJS(...)) is not a function

at null.<anonymous> (functionsWorker-0.6318978794915122.js:90322:54) in

../node_modules/readable-stream/lib/_stream_readable.js
at null. (functionsWorker-0.6318978794915122.js:984:51) in __require22
at null. (functionsWorker-0.6318978794915122.js:91325:32) in
../node_modules/readable-stream/readable-browser.js
at null. (functionsWorker-0.6318978794915122.js:984:51) in __require22
at null. (functionsWorker-0.6318978794915122.js:91345:25) in
../node_modules/keccak/lib/api/keccak.js
at null. (functionsWorker-0.6318978794915122.js:984:51) in __require22
at null. (functionsWorker-0.6318978794915122.js:91490:24) in
../node_modules/keccak/lib/api/index.js
at null. (functionsWorker-0.6318978794915122.js:984:51) in __require22
at null. (functionsWorker-0.6318978794915122.js:91814:22) in
../node_modules/keccak/js.js
at null. (functionsWorker-0.6318978794915122.js:984:51) in __require22

✘ [ERROR] MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.**

If I comment out the line where I initialize the stream, worker does not crash.
Link to the function I would like to use from the SDK: https://js-sdk-docs.streamflow.finance/classes/_streamflow_distributor.solana.SolanaDistributorClient.html#getClaims

Cloudflare worker compatibility date: Nov 11, 2024

Please let me know if any other info is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant