-
Notifications
You must be signed in to change notification settings - Fork 125
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
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory #586
Comments
Hi @amnambiar ! Could you provide code example to reproduce the error ? |
Hey @lisicky , I've tried to quickly put together a repo here: https://github.com/amnambiar/my-app Just try to fork/download the folder and You should be able to see the below error , for which the trace is not exactly same to the one mentioned above - still the same
I have the transaction specific code mentioned within App.tsx itself. Can you help me if it is in any way related to the way I am building the transaction? |
Hi, An additional update regarding the issue. The node version I am on right now is 17.9.0 |
@amnambiar I need some time to investigate it probably it is normal behavior. Also you can use GENERATE_SOURCEMAP=false env or use cardano-serialization-lib-browser package it should be lighter than asmjs version. Here #575 (comment) you can find some information for troubleshooting if you decide to use cardano-serialization-lib-browser |
@lisicky Thank you, Trying to use cardano-serialization-lib-browser instead of the asmjs, It threw errors, an excerpt below:
|
@amnambiar I have a simple react app with the CSL. You can compare it with your project config https://github.com/lisicky/csl_react_test |
@amnambiar I have updated config for you. Check the repo |
@lisicky Great, a Quick one! Yes, your app works. Trying it in the sample app https://github.com/amnambiar/my-app, I am getting the below error: But, doesn't work in my main application. Still got the same set of errors - |
@amnambiar check please configs, even package.json and config-overrides.js |
@amnambiar and check scripts section in package.json |
This worked !! Thanks a lot |
Hey, I'm not really seeing anything new under scripts in package.json except can you tell me what you did different or added to the scripts? I am trying to follow this example to get my WSM working in react with Webpack5 as well as recommended in my issue #585 . Thanks, |
Ahh I see now the github example from @lisicky. Do I need to run the eject script first? Thanks. |
NVM Got it working |
Does anyone get this warning? WARNING in ./node_modules/@emurgo/cardano-serialization-lib-browser/cardano_serialization_lib_bg.js 26907:14-53 |
Hi,
On trying to use the latest version of asmjs package, to request a transaction from the wallet from a react-app, trying to bundle the app with
npm run start
throws JavaScript Heap error. I am using the below version of the package:"@emurgo/cardano-serialization-lib-asmjs": "^11.2.1"
The below is the error I can see in my terminal:
I have found that the basic fix to JavaScript heap errors is to increase the
--max-old-space-size
allocation to >8GB withinNODE_OPTIONS
globally or include it in the scripts. Also, the allocation size seemed to vary among host machines, and we couldn't come to a conclusion of what size to use. It didn't make sense to blindly allocate a huge space.But this doesn't seem like the only and main reason behind this error.
I believe that it is some issue within this version of the package or the package itself, because while trying to use a lower version like 10.2.0 as suggested in https://stackoverflow.com/a/73627677, these heap errors did not occur. But instead, there were not found errors for methods
.from_bech32
,.coins_per_utxo_byte
etc.Can someone please have a look at it, or correct me if I am wrong.
The text was updated successfully, but these errors were encountered: