Open ziriax opened 5 years ago
Mmm, it seems a similar errors occurs when reverting the SodiumJS 1.1.3 (send being called before listeners are attached, and that gets rethrown), so this problem must have been introduced by upgrading other packages.
With the latest version (3.0.5) this send being called
error is not thrown, but the code crashes as reported above.
I wonder if sodium-frp-react library has bundled its own sodiumjs with its own global scope separate from the global scope of sodium-frp-react-demo. Sort of like the library is loaded twice and it is passing sodium objects between the two sodium libraries.
In other words one sodium lib currentTransaction is not null, and the other bundled sodium lib currentTransaction is null.
Like #50.
Might have to try:
export const sodium = window["sodium"] as typeof import("sodiumjs");
On both and include sodium initially in a script tag. Bit messy though.
Similar issue here with angular. https://github.com/webpack/webpack/issues/2134
This guy has a solution. https://github.com/webpack/webpack/issues/2134#issuecomment-192579511
(Make sodiumjs a "peerDependency" in sodium-frp-react)
Ah! Thanks a lot, I will try that
I'm trying to port my old
sodium-frp-react-demo
to the latest versions of SodiumJS and ReactJS, but I get a crash when running, any idea what this might be? I'm creating cell loops, so I do this insideTransaction.Run
, but this crashes in the latest version, works fine in the very old version I was using.Stack trace: