[go: nahoru, domu]

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

Can Node API be removed from dependency? (Deno support) #1522

Open
xumx opened this issue Jun 13, 2024 · 2 comments
Open

Can Node API be removed from dependency? (Deno support) #1522

xumx opened this issue Jun 13, 2024 · 2 comments
Labels
enhancement New feature or request sdk

Comments

@xumx
Copy link
xumx commented Jun 13, 2024

When trying to load the Javascript SDK (v1.0.3) on Deno serverless environments, I get the following Error.

Error: Node API is not supported in this environment
    at Object.Module._extensions..node (node:module:776:20)
    at Module.load (node:module:654:32)
    at Function.Module._load (node:module:522:12)
    at Module.require (node:module:673:19)
    at require (node:module:787:16)
    at Object.<anonymous> (file:///node_modules/.deno/pgml@1.0.3/node_modules/pgml/index.js:16:16)
    at Object.<anonymous> (file:///node_modules/.deno/pgml@1.0.3/node_modules/pgml/index.js:26:4)
    at Module._compile (node:module:729:34)
    at Object.Module._extensions..js (node:module:743:10)
    at Module.load (node:module:654:32)

Given that the pgml has a serverless GPU product, we should expect the client SDK to be runnable on more serverless/edge runtimes.

@levkk
Copy link
Contributor
levkk commented Jun 13, 2024

The SDK core is written in Rust to provide a uniform implementation across several languages (JavaScript, Rust, Python, Zig, etc.). To achieve this, we're using neon which uses the Node native extensions API. Therefore, our SDK currently can only run on standard Node.js.

As we build it out more, it's not impossible for us to port it to use Deno, but we would much rather have Deno add support for native Node extensions, as it should if it expects to support the entire JavaScript ecosystem of packages.

We'll keep this issue open in the meantime.

@levkk levkk added enhancement New feature or request sdk labels Jun 13, 2024
@xumx
Copy link
Author
xumx commented Jun 14, 2024

Maybe in the future you can consider compiling from Rust to WebAssembly, distributing a WASM bundle could be more universally supported across programming languages & runtimes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request sdk
Projects
None yet
Development

No branches or pull requests

2 participants