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

Uncaught (in promise) InternalError: too much recursion #23

Open
lig76 opened this issue Jul 23, 2024 · 2 comments
Open

Uncaught (in promise) InternalError: too much recursion #23

lig76 opened this issue Jul 23, 2024 · 2 comments

Comments

@lig76
Copy link

lig76 commented Jul 23, 2024

Hi,

I'm using method
await socketlib.system.executeAsGM('showOptionBox', inputs, activeMods);
to call the Option window for other player/GM.
I got the result:

Uncaught (in promise) InternalError: too much recursion
    be is-binary.js:3
    Ee is-binary.js:20
    Ae is-binary.js:36
    Ae is-binary.js:45
    Ae is-binary.js:45
    Ae is-binary.js:45
    Ae is-binary.js:45
    Ae is-binary.js:45
    Ae is-binary.js:45
    Ae is-binary.js:45
    Ae is-binary.js:45
    Ae is-binary.js:45
    Ae is-binary.js:45
    Ae is-binary.js:45
    Ae is-binary.js:45
    Ae is-binary.js:45
    Ae is-binary.js:45

This happens only if I set target of an action in Foundry.

@manuelVo
Copy link
Owner

One limitation of socketlib is, that you can only send data to other clients that can be serialized to JSON. If you try to send a datastructure that references itself at some point, the json serializer gets stuck in an infinite recursion and eventually bails. I suppose that's what is happening here. What are the contents of the variables inputs and activeMods?

@lig76
Copy link
Author

lig76 commented Jul 24, 2024

While activeMods is empty, inputs differs depending who call it.
In problematic case, it's big nested (tree-like) object.
I made yesterday workaround - the recipient only required a few fields from input, so I have filtered it and it helped.
(The recursion error was displayed on Firefox; on Chrome it was sth about too big thread stack or sth similar)

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