-
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
Size of CSL library in react-app #575
Comments
I managed to import the nodejs version which is significantly smaller. However, I get this error cardano_serialization_lib.js:26 Uncaught TypeError: TextDecoder is not a constructor |
It does not help much. They recommend using asmjs version of CSL which is what I want to avoid. using broweser version gives a large list of errors in the format of ERROR in ./node_modules/@emurgo/cardano-serialization-lib-browser/cardano_serialization_lib_bg.js 27:40-58 |
@lisicky how can I use wasm-loader to import cardano-serialization-lib-browser to a reactjs application? |
@Fourzin it might help #295 (comment)
you can try to delete it. Also this repo can help to override webpack config https://github.com/timarney/react-app-rewired |
@lisicky neither worked. I already have react-app-rewired installed. I tried edidting the webpack to add the changes in #295 however the same errors stayed. I also tried to copy the config code of webpack config as is but the compiler does not start and give an error of "overrides.webpack is not a function" |
@lisicky ok I got it work by modifying the webpack config using #295 and what I already have added through the search. However, it only works locally. If I deploy the files online the page does not load and I get the following error Uncaught (in promise) TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'. |
@lisicky Unfortunately many answers are not complete. I understand the issue now better, but I need to know how to enable mime type in the hosting server I guess from what I understood. Will look that up |
Hi, I am importing CSL in a react app. using the asmjs package i.e. "import * as WASM @emurgo/@emurgo/cardano-serialization-lib-asmjs;"
The project works fine. However, the overall size of the project is huge. 48 MB. Without the CSL package it goes down to 2 MB. Is this normal?
The text was updated successfully, but these errors were encountered: