You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This top level await is probematic. For build tools like vite and rollup it requires a special top level await plugin to be used correctly. For next.js with app router it throws a very confusing error
A simple solution is to just wrap this await in a class
There might be better solutions for dealing with this with wasm that I'm unaware of.
Not wrapping it is a breaking change and would require changes to ethereumjs uses of this too. Would be nice if we could remove the top level await without breaking change
The text was updated successfully, but these errors were encountered:
Looked more into this and it is possible to instanciate the wasm module syncronously. But it's generally not ideal because it would make it impossible to use this library on the main thread in the browser as it would block the main thread with an expensive wasm compile.
There is a top level await here: https://github.com/ethereumjs/rustbn-wasm/blob/master/src.ts/rustbn.ts#L159
This top level await is probematic. For build tools like vite and rollup it requires a special top level await plugin to be used correctly. For next.js with app router it throws a very confusing error
A simple solution is to just wrap this await in a class
There might be better solutions for dealing with this with wasm that I'm unaware of.
Not wrapping it is a breaking change and would require changes to ethereumjs uses of this too. Would be nice if we could remove the top level await without breaking change
The text was updated successfully, but these errors were encountered: