Skip to content
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

RangeError: Maximum call stack size exceeded #585

Closed
bakon11 opened this issue Jan 29, 2023 · 8 comments
Closed

RangeError: Maximum call stack size exceeded #585

bakon11 opened this issue Jan 29, 2023 · 8 comments

Comments

@bakon11
Copy link

bakon11 commented Jan 29, 2023

Whenever I use the ASMJS version of the CSL, since version 11.2.x. After I create a single transaction successfully.
The second time around I get the error "RangeError: Maximum call stack size exceeded".
However once I refresh the browser it works again for a single transaction creation?

I am using this with Newest version of React18, Create React App 5 and Webpack5 if this matters.

Again prior to version 11.2.x I did not have this problem, I could create TX's to my heart's content without having to refresh the website.

Please let me know if you need anymore information.

Thanks,
Mike

@lisicky
Copy link
Contributor

lisicky commented Jan 29, 2023

Hi @bakon11 ! Could you provide code example to reproduce the error ? It would be better if the example will be with package.json file

@bakon11
Copy link
Author

bakon11 commented Jan 30, 2023

Yes of course.

I included my package.json and my TX building JS file.

The TX just creates a simple pool delegation transaction.

Thank you,
Mike

code.zip

@bakon11
Copy link
Author

bakon11 commented Jan 30, 2023

Hmm ok so I was able to get past that error now I am getting:

Failed to execute 'decode' on 'TextDecoder': The encoded data was not valid.

Here is console output:

delegate tx error TypeError: Failed to execute 'decode' on 'TextDecoder': The encoded data was not valid.
    at getStringFromWasm0 (cardano_serialization_lib_bg.js:39:1)
    at __wbindgen_string_new (cardano_serialization_lib_bg.js:26881:1)
    at $1282 (cardano_serialization_lib.asm.js:367485:1)
    at Module.$3019 (cardano_serialization_lib.asm.js:480271:1)
    at Address.from_hex (cardano_serialization_lib_bg.js:995:1)
    at createDelegateTxWebWallet (txbuilderCSL.jsx:25:1)
    at async delegateTX (DeleagtePopup.jsx:33:1)
    at async startDelegation (DeleagtePopup.jsx:53:1)

THANKS!!!

@lisicky
Copy link
Contributor

lisicky commented Jan 30, 2023

@bakon11 How did you manage the first error ? For TextDecoder error look this issue #150

@bakon11
Copy link
Author

bakon11 commented Jan 31, 2023

My running npm install -force instead of npm install --legacy-peer-deps

As for the second one For TextDecoder error look this issue https://github.com/Emurgo/cardano-serialization-lib/issues/150

I would agree with this, except I still have the same symptoms as described in the original post except this time it's this error and not the call stack size. Where first time calling the genTX function works fine but anything after that I need to refresh browser.

Honestly though, I'm starting to think that maybe I should probably just get WASM loaded properly in my react project like some of the other threads suggest??

Thanks,
Mike

@lisicky
Copy link
Contributor

lisicky commented Feb 1, 2023

@bakon11 Error with TextDecoder usually related to a webpack config if webpack version is >= 5, it doesn't matter which version of CSL you use browser or asmjs. And I recommend to read the link that I gave above. Also if you don't have limitation to use only asmjs version, you can use browser version. This messages #575 (comment) and #586 (comment) can help you to troubleshoot problems during cardano-serialization-lib-browser integration.

@bakon11
Copy link
Author

bakon11 commented Feb 1, 2023

No constraints yet, I will start by getting webpack configured properly first and then see about loading up the browser one.

Don't want to drag down two issues at once hehe.

Thank you.

@bakon11
Copy link
Author

bakon11 commented Feb 4, 2023

Found answer in #586

@bakon11 bakon11 closed this as completed Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants