-
Notifications
You must be signed in to change notification settings - Fork 127
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
cardano_serialization_lib_bg.js includes a "require" #119
Comments
It's just a warning so it should be fine. The code you're referring to is automatically generated so it's not really practical to try and modify it all the time. The better solution would be to update to a wasm bindgen version that fixes this, but upgrading that caused the ASM.js package to fail to compile due to some other downstream issues. It looks like it may have finally been resolved (rustwasm/wasm-pack#886 (comment)) but I haven't looked into this yet |
I do it manually for now, no problem. If it would be just a warning I wouldn't post it here. It actually causes the compiler to fail, at least for me. So yeah. All good for now. |
For Yoroi we use both the nodejs and the browser bindings just fine so maybe you have an issue in your setup code https://github.com/Emurgo/yoroi-frontend |
I'm running into the same issue, can you please tell me where in this file is causing that error so I can also comment it out. It's a very big file, i'm not entirely sure where this is being caused from. Thanks in advance |
Search for require( there are two lines with that string, one reads module.require( the other one reads require( Add module. then you are good to go. |
Legend! Thanks so much for such a quick reply. Been scratching my head for 2 days trying to work this out. |
Your answer worked for when I can comment it out directly in the file, which is good when running this locally. |
I do compile the web target myself, so it's not a dependency in a package.json, but rather a file that gets transpiled into the final app. |
How did you manage to do this? |
#./src/cardano/serialization-lib/@emurgo/cardano-serialization-lib-browser/cardano_serialization_lib_bg.wasm Échec de l'analyse du module : l'en-tête magique n'est pas détecté Le fichier a été traité avec les chargeurs suivants: * ./node_modules/file-loader/dist/cjs.js Vous aurez peut-être besoin d'un chargeur supplémentaire pour gérer le résultat de ces chargeurs. Erreur: en-tête magique non détecté |
The warning still shows up with the most recent version 11.2.1 (2022-12-19 14:27:46). As a workaround, I temporarily added a webpack "ignoreWarnings" object for the module "@emurgo/cardano-serialization-lib-browser/cardano_serialization_lib_bg.js" (regex) to my project. But Sebastiens solution would still be the best. |
Thanks for this awesome lib.
The browser package includes a "require()" call in cardano-serialization-lib-browser/cardano_serialization_lib_bg.js
Would it be possible to get rid of that call? I have to comment out the whole function otherwise I see:
The text was updated successfully, but these errors were encountered: