Skip to content

[Bug] SDK fails to initialize in Deno #864

@hacklschorsch

Description

@hacklschorsch

🐛 Bug Report

I would like to use the Deno JS runtime but cannot - the Aleo SDK crashes during initialization.

Steps to Reproduce

  1. Run reproducer below in deno: deno run --allow-read --allow-env --allow-run deno-aleo-init-fail.js

Code snippet to reproduce

deno-aleo-init-fail.js:

import { Account, Program, ProgramManager } from '@aleohq/sdk'

console.log("Hello")

package.json:

{
  "name": "aleo-deno-reproducer",
  "dependencies": {
    "@aleohq/sdk": "^0.6.9"
  }
}

Stack trace & error message

error: Uncaught Error: Invalid port number string returned:
    at findPort ([redacted]/aleo-deno-reproducer/node_modules/.deno/[email protected]/node_modules/sync-rpc/lib/index.js:70:11)
    at start ([redacted]/aleo-deno-reproducer/node_modules/.deno/[email protected]/node_modules/sync-rpc/lib/index.js:32:16)
    at sendMessage ([redacted]/aleo-deno-reproducer/node_modules/.deno/[email protected]/node_modules/sync-rpc/lib/index.js:133:17)
    at createClient ([redacted]/aleo-deno-reproducer/node_modules/.deno/[email protected]/node_modules/sync-rpc/lib/index.js:173:27)
    at Object.<anonymous> ([redacted]/aleo-deno-reproducer/node_modules/.deno/[email protected]/node_modules/sync-request/lib/index.js:16:14)
    at Object.<anonymous> ([redacted]/aleo-deno-reproducer/node_modules/.deno/[email protected]/node_modules/sync-request/lib/index.js:36:4)
    at Module._compile (node:module:733:34)
    at Object.Module._extensions..js (node:module:747:10)
    at Module.load (node:module:658:32)
    at Function.Module._load (node:module:539:12)

Expected Behavior

The SDK should work the same as it does in Node.

Your Environment

  • Aleo SDK 0.6.9
  • Deno 1.38.2
  • NixOS 23.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions