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

Request: Deno support + jsr.io publication #242

Open
Nehoko opened this issue Jan 21, 2025 · 2 comments
Open

Request: Deno support + jsr.io publication #242

Nehoko opened this issue Jan 21, 2025 · 2 comments

Comments

@Nehoko
Copy link

Nehoko commented Jan 21, 2025

Hi! Currently our team is building new Deno app based on your library and we've found something we'd like to be changed.

JSR.io publication

It would be great to found your library in jsr.io package registry. It has several improvements in comparison with npm (see here: https://jsr.io/#why-jsr)

Deno support

It does not work with Deno (v2.1.6) and arlocal container (v1.1.66). It can be seen by publishing transaction into arlocal. The Arlocal error is next:

[1/21/2025, 8:08:15 AM]   <-- POST /tx
{
  error: 'Validation Error',
  validationErrors: [ 'transaction "signature" is invalid' ]
}

The app logs are next:

Transaction fcha6_dnd04QS5NC1foFVCVqvylti9V7oLL0orREloE is valid
Current Balance: 100000000000
Error: ArweaveRepository: cannot publish data to block-chain: Bad Request
 

We had a conversation here #223 about other runtimes support and our team has tried several options that were suggested during the conversation, but nothing works.
We're hoping on your assistance

Environment

  • Deno (v2.1.6)
  • Arweave-js (v1.15.5)
  • Node (v23.6.0)
  • Arlocal (v1.1.66 in Docker container)

P.S. If demo app is a must, we could do it in a few days.

@rosmcmahon
Copy link
Member

thanks for opening the issue. IIRC both bun and deno have an issue with an incomplete/incompatible versions of node:crypto.
nodejs now supports webcrypto standard, so the dual web/node feature of arweave-js will be removed in a later date in favour of a combined webcrypto interface.

from #223 this looks like it will fix compatibility with bun, but not deno.

actually, a few thoughts on that:
n.b. i'm not a deno guy, but did you try importing like

import * as Arweave from "https://unpkg.com/[email protected]/web/index.js"

might help if it's an esm/cjs import issue.

or can you turn on something like "synthetic default imports" in deno?

@Nehoko
Copy link
Author

Nehoko commented Jan 22, 2025

hey, @rosmcmahon!
Thanks for the reply.

might help if it's an esm/cjs import issue.

Unfortunately, it is not the case: I've tried several options, but all of them lead to the same issue: the signature for arweave server is not valid (even if linter tells me sth wrong with imports).

or can you turn on something like "synthetic default imports" in deno?

Nope: denoland/deno#17058

P.S.
What about jsr.io publishing? We really would appreciate it.

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

2 participants