Next.js Discord

Discord Forum

Imported package that use WASM and got error

Unanswered
Sun bear posted this in #help-forum
Open in Discord
Avatar
Sun bearOP
I imported package that uses wasm and called some method from the package and have got an error as on screenshot
Image

5 Replies

Avatar
Oriental
hi! Yeah I'm not sure much what to do here either, what I did was load the wasm as a script in a custom document and then just referenced it in useEffects as a global variable
if you reference it with an import then webpack will try to mangle it with bundling which is probably not desired
Avatar
Sun bearOP
Thank you for the answer! Could you provide next js config?
Avatar
Oriental
Avatar
Sun bearOP
Thank you