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

ERROR: ErrorException: Undefined array key 0 #1178

Closed
yasirhashmi88 opened this issue Feb 1, 2022 · 3 comments · Fixed by #1180
Closed

ERROR: ErrorException: Undefined array key 0 #1178

yasirhashmi88 opened this issue Feb 1, 2022 · 3 comments · Fixed by #1180
Labels

Comments

@yasirhashmi88
Copy link

yasirhashmi88 commented Feb 1, 2022

  • Telescope Version: 4.7.1
  • Laravel Version: 8
  • PHP Version: 8
  • Database Driver & Version: MySQL 8.0.23

Description:

Getting ERROR: ErrorException: Undefined array key 0 in /var/www/hr/vendor/laravel/telescope/src/Watchers/ModelWatcher.php:74

  • If I set 'hydrations' => false, in telescope.php, it works.
  • I noticed the key of an array comes as string like model and doesn't comes as 0

Steps To Reproduce:

1 - I have existing Laravel app which have different models but I believe this can be replicated on fresh Laravel installation.
2 - Run composer require laravel/telescope:4.7.1 --dev. I have tried multiple versions but still no luck.
3 - Try open your app in browser. You should see the error in the console or your logs.

@driesvints
Copy link
Member

I think this is related to my PR here: #1174. Seems that associative keys are kept because of the decoding. But it's beyond me why they're being recorded again.

@driesvints
Copy link
Member

@yasirhashmi88 can you try out #1180 ?

@yasirhashmi88
Copy link
Author

@yasirhashmi88 can you try out #1180 ?

@driesvints Yes. That's fixes the issue.

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

Successfully merging a pull request may close this issue.

2 participants