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

[javascript processor] Update goja packages to the latest versions #2910

Closed
heikkilamarko opened this issue Sep 30, 2024 · 1 comment · Fixed by #2911
Closed

[javascript processor] Update goja packages to the latest versions #2910

heikkilamarko opened this issue Sep 30, 2024 · 1 comment · Fixed by #2911

Comments

@heikkilamarko
Copy link
Contributor

heikkilamarko commented Sep 30, 2024

Hi, I tried using the Math.js (https://mathjs.org/) library in the javascript processor:

input:
  generate:
    mapping: |
      root.a = [[1, 2], [3, 4]] 
      root.b = [[5, 6], [1, 1]]
    count: 10
    interval: ""

pipeline:
  processors:
    - javascript:
        code: |
          function run() {
            const math = require("mathjs")
            const root = benthos.v0_msg_as_structured()
            root.result = math.multiply(root.a, root.b)
          }
          run();
output:
  file:
    path: out.json

logger:
  level: DEBUG

However, this gave me an error because the goja version that Redpanda Connect is using is outdated and does not support BigInt. I created a custom build where I updated the goja and goja_nodejs packages to the latest version, and the pipeline started to work.

Screenshot 2024-09-30 at 19 37 57

Is there any chance these packages could be updated, so that a custom build is no longer needed?

@heikkilamarko
Copy link
Contributor Author

heikkilamarko commented Sep 30, 2024

BigInt support was added to goja in this PR (Aug 22): dop251/goja#597

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

Successfully merging a pull request may close this issue.

2 participants