Skip to content

ErrorException QueryDetector.php:78 #91

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

Closed
tomohirohiratsuka opened this issue Aug 20, 2022 · 1 comment · Fixed by #92
Closed

ErrorException QueryDetector.php:78 #91

tomohirohiratsuka opened this issue Aug 20, 2022 · 1 comment · Fixed by #92

Comments

@tomohirohiratsuka
Copy link

tomohirohiratsuka commented Aug 20, 2022

Hi, thank you for creating awesome package.

I've been facing error while debugging api.

error  Undefined array key 0 Array(1) { userId: 5 } 
ErrorException QueryDetector.php:78

Looking at the source code, I think the cause is that an associative array is returned where an array is expected to be returned, but I'm not sure if I'm using it wrong or not.

$sources = $this->findSource($backtrace);

@scottzirkel
Copy link
Contributor

It looks like $sources can return an empty array, but there is no check for that, so the error is thrown from the next line, which attempts to access the first value in the array. Hopefully the PR can be looked at soon and fixed, this has been plaguing me for a few months now. I still don't know how to cause it, I only know some of the queries are logged properly, and some aren't.

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

Successfully merging a pull request may close this issue.

2 participants