-
Notifications
You must be signed in to change notification settings - Fork 124
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
__dirname is not sufficient to derive the path to WASM file #624
Comments
This appears to be a problem with |
@lisicky I'm using Which i'm pretty confident is correct, as the code isn't being run in the browser. If you are familiar with NextJs, in the reproduction you will see that the code is being run inside |
Thanks for clarification @mPaella ! It's better to create issue in Wasm-pack or next.js repo. Because it is issue of third-party tool |
Seems it was done by vercel/next.js#49783 |
Problem
The compiled lib uses
__dirname
to resolve the path tocardano_serialization_lib_bg.wasm
file, which does not always resolve correctly. CausingError: ENOENT: no such file or directory, open '/project/sandbox/.next/server/app/foo/cardano_serialization_lib_bg.wasm'
Reproduction
https://codesandbox.io/p/sandbox/gifted-einstein-mo56ss?file=%2Fnext.config.js%3A19%2C7
/
. See that the page loads/foo
. See that the page errors, due to incorrectly deriving the path to the WASM fileFix?
As a hack to see if i could fix it, I tried editing the compiled files for
@emurgo/cardano-serialization-lib
undernode_modules
.OLD - Not working - line ~14053 in the compiled code
NEW - Working
The text was updated successfully, but these errors were encountered: