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

Bug: Maximum call stack exceeded on hot reload when assigning element to context #4985

Open
jjenzz opened this issue Jul 16, 2024 · 2 comments
Labels

Comments

@jjenzz
Copy link

jjenzz commented Jul 16, 2024

XState version

XState version 5

Description

in a NextJS 14 app router project, i'm assigning an element to context on mount. if i make changes to my code that trigger a hot reload, i get the following errors:

CleanShot 2024-07-16 at 17 09 56

i can only replicate this when assigning an HTMLElement. assigning a string works fine.

Steps to reproduce

  • open the StackBlitz
  • open devtools and enable preserve logs
  • change the contents of the <div> to trigger a hot reload
  • observe the preserved errors in the log
CleanShot.2024-07-16.at.17.17.40.mp4

Expected result

hot reload would succeed without errors

Actual result

maximum call stack exceeded

Reproduction

https://stackblitz.com/edit/stackblitz-starters-hocxhz?description=The%20React%20framework%20for%20production&file=app%2Ftest.tsx,app%2Fpage.tsx&title=Next.js%20Starter

Additional context

No response

@jjenzz jjenzz added the bug label Jul 16, 2024
@Andarist
Copy link
Member

I believe this is a duplicate of: #4645

@davidkpiano
Copy link
Member

Thanks for the repro! Seems like the issue is with the persistContext(…) function getting into a cycle. Will investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants