chore: support deno 2.0 by replacing __dirname -> import.meta.dirname.
For this issue https://github.com/denosaurs/sodium/issues/4
Tests keep failing because of Uncaught TypeError: h is not a function trying to figure it out.
On further investigation it's crashing while trying to print why it crashed...
Real error is
"Error: Both wasm and asm failed to loadTypeError: Cannot read properties of undefined (reading 'rc')\n at file:///C:/Repos/sodium-fork/dist/browsers/sodium.js:49916:35"
Strange, and you get the same error locally when running the tests? Seems like the built code is somehow wrong.
Getting it locally as well yeah. I'm gonna give it a shot on a Linux machine see if it makes a difference.
Also another idea.. do you know where the build code originally came from? Maybe there's an updated version?
Tried running the tests on deno 1.x and it worked. I guess the js build files don't work in deno 2.x. Need to figure out how to update them.
There wouldn't happen to be a un-uglified version of the sodium.js build file somewhere?
Looks like the files came from here originally https://github.com/jedisct1/libsodium.js. I'll try and update them and see what happens.
Have you tried using libsodiumjs (or even the web standard crypto if that fits your needs) directly? It may be easier to depend on it than this, honeslty ill-maintained wrapper module.
I hadn't heard of libsodiumjs until I started looking into this. It would be easier to just use that... but I it'd be nice if this was working for Deno users. So they can use sodium without needing to think.
I don't mind continuing to work on this if no one else is gonna do it. It's an excuse to learn something on my end.
I hadn't heard of libsodiumjs until I started looking into this. It would be easier to just use that... but I it'd be nice if this was working for Deno users. So they can use sodium without needing to think.
Well, if you are doing anything requiring libsodium and crypto, I would hope the user thinks long and hard about the problem theyre trying to solve if it has anything to do with authentication, signing, etc. But I get the need for basic access to cryptographic functions when for example interacting with an API.
I don't mind continuing to work on this if no one else is gonna do it. It's an excuse to learn something on my end.
Go for it! I would appreciate it!
Btw @eliassjogreen I noticed you're also apart of the https://github.com/denosaurs/opus repo. I created a fix for that repo here https://github.com/denosaurs/opus/pull/3. It's a lot simpler than this...
Found this issue trying earthstar, any updates?