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

Livewire 3 & SPA Mode: "Maximum call stack size exceeded" #1567

Closed
devajmeireles opened this issue Mar 11, 2024 · 11 comments
Closed

Livewire 3 & SPA Mode: "Maximum call stack size exceeded" #1567

devajmeireles opened this issue Mar 11, 2024 · 11 comments

Comments

@devajmeireles
Copy link

I updated one of my projects to use Livewire 3 in SPA mode (wire:navigate) and after that, I noticed that DebugBar throws an error in the console log stating "Maximum call stack size exceeded".

CleanShot 2024-03-11 at 11 16 09

... With this, the DebugBar stops to be rendered.

I confirmed that this error is related to Livewire 3's SPA mode because when I remove this, this error no longer appears.

@devajmeireles
Copy link
Author

It looks like the error is here:

CleanShot 2024-03-11 at 11 21 21

@barryvdh
Copy link
Owner

@erikn69 because of maximebf/php-debugbar#606 ?

@barryvdh
Copy link
Owner

Hmm not really familiar with SPA mode, but probably because the parent is resolving to itself?

@barryvdh
Copy link
Owner

Or maybe we can just check if the parent debugbar is not the same object as the current debugbar, to prevent a loop?

What is the easiest to replicate this? It seems turbolinks is deprecated for 2 years?

@erikn69
Copy link
Contributor

erikn69 commented Mar 11, 2024

Maybe, maximebf/php-debugbar#613 (comment)

window.parent && window.parent != window.top && window.parent.phpdebugbar && window.parent.phpdebugbar != this

I have no way to test it, @devajmeireles could you test it??

@devajmeireles
Copy link
Author

@erikn69 @barryvdh ,

I was able to confirm that the new version was able to fix the issue. I'll mark this as resolved. Thanks!

@erikn69
Copy link
Contributor

erikn69 commented Mar 11, 2024

the new version was able to fix the issue

new version not was a fix, was a regression, maximebf/php-debugbar#613 (comment) was a possible fix, but I was hoping you could corroborate it because I can't replicate your environment

@devajmeireles devajmeireles reopened this Mar 11, 2024
@devajmeireles
Copy link
Author

the new version was able to fix the issue

new version not was a fix, was a regression, maximebf/php-debugbar#613 (comment) was a possible fix, but I was hoping you could corroborate it because I can't replicate your environment

What do you prefer? A demo repo or better instructions to test that piece of code?

@erikn69
Copy link
Contributor

erikn69 commented Mar 11, 2024

Nevermind, i did reproduce the problem

@devajmeireles
Copy link
Author

devajmeireles commented Mar 11, 2024

Awesome! Anyway, here is the demo repo: https://github.com/devajmeireles/bug-debugbar

  1. Clone and setup the repo
  2. Prepare the .env. using SQLite
  3. Run the migrations
  4. Create an account
  5. Open the browser console
  6. Navigate between the links at the top of the page

I needed to create the repo using the v1.20.0 of maximebf/php-debugbar

@erikn69
Copy link
Contributor

erikn69 commented Mar 13, 2024

Fixed on #615

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

3 participants