Open Fumiya-Kai opened 1 year ago
If you use the Json response, it sets the correct headers and doesn't inject the debugbar.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this issue is still present on the latest version of this library on supported Laravel versions, please let us know by replying to this issue so we can investigate further. Thank you for your contribution! Apologies for any delayed response on our side.
When I use
fetch
of javascript, I kept seeingUncaught (in promise) SyntaxError: Unexpected non-whitespace character after JSON at position ~
.How to reproduce
environment
MacOS 11.3.1 chrome 109.0.5414.87 php 8.0.18 laravel 9.45.1 laravel-debugbar 3.7
what I did
DEBUGBAR_ENABLED = TRUE
※if disable laravel-debugbar, I succeeded.
DEBUGBAR_ENABLED = FALSE
Make Api
Fetch using js
Start server as follows
php artisan serve
I failed fetch because of the following error.
Uncaught (in promise) SyntaxError: Unexpected non-whitespace character after JSON at position ~
Expected
I expected response data is shown in console as follows.
laravel-debugbar inject code after response data.
I propose stopping inject code when JSON response.