laravel / pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.
https://pulse.laravel.com
MIT License
1.43k stars 165 forks source link

Pulse keeps loading livewire component, does not render #98

Closed ysrdevs closed 10 months ago

ysrdevs commented 10 months ago

Pulse Version

1.0.0

Laravel Version

10.4.1

PHP Version

8.3

Description

Screenshot 2023-12-01 at 8 59 39 PM

The database has pulse data and I can see recorded activity there as well but the /pulse route is not displaying the data. Same on local machine using Laravel Herd and also on Laravel Forge online

Steps To Reproduce

composer require laravel/pulse php artisan migrate

The /pulse route shows the pulse menu but no data

ahinkle commented 10 months ago

What exceptions / console log errors are you getting?

ysrdevs commented 10 months ago

What exceptions / console log errors are you getting?

No error log in console, If I test on Forge I don't see anything in the logs either.

Screenshot 2023-12-01 at 9 05 36 PM
attaryz commented 10 months ago

i also received this error.

when using telescope package logs i got this error: Call to undefined method Symfony\Component\HttpFoundation\BinaryFileResponse::header()

ahinkle commented 10 months ago

Interesting. What's your output on php artisan about?

Is this a duplicate of https://github.com/laravel/pulse/issues/85?

attaryz commented 10 months ago

i got it to work by disabling the CORS middleware.

github-actions[bot] commented 10 months ago

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

PerryvanderMeer commented 10 months ago

@ysrdevs any chance you use Livewire in your project and have inject_assets disabled? Looks like Livewire isn't loaded at all (see #87 and #88).

ysrdevs commented 10 months ago

Interesting. What's your output on php artisan about?

Is this a duplicate of #85?

This is what I get

php artisan about

Environment .......................................................................................................... Application Name ........................................................................................... website Laravel Version .............................................................................................. 10.34.2 PHP Version .................................................................................................... 8.3.0 Composer Version ............................................................................................... 2.5.5 Environment .................................................................................................... local Debug Mode ....................................................................................................... OFF URL .................................................................................................... websitename.com Maintenance Mode ................................................................................................. OFF

Cache ................................................................................................................ Config .................................................................................................... NOT CACHED Events .................................................................................................... NOT CACHED Routes .................................................................................................... NOT CACHED Views ......................................................................................................... CACHED

Drivers .............................................................................................................. Broadcasting ..................................................................................................... log Cache ........................................................................................................... file Database ....................................................................................................... mysql Logs .................................................................................... stack / single, daily, flare Mail ............................................................................................................ smtp Octane .................................................................................................... roadrunner Queue ........................................................................................................... sync Session ......................................................................................................... file

Livewire ............................................................................................................. Livewire ...................................................................................................... v3.2.2

ysrdevs commented 10 months ago

@ysrdevs any chance you use Livewire in your project and have inject_assets disabled? Looks like Livewire isn't loaded at all (see #87 and #88).

This solves it.

Adding @livewireScripts just before the closing BODY tag fixes it. The issue is with livewire not injecting assets to the pulse dashboard. The file sits at vendor/laravel/pulse/resources/views/components/pulse.blade.php

gofish543 commented 10 months ago

Similar issue, needed to add...

@vite('resources/js/app.js')
@livewireScriptConfig(['nonce' => Vite::cspNonce()])

@livewireStyles(['nonce' => Vite::cspNonce()])

to the dashboard.blade.php file

I have inject_assets disabled and manually start Alpine / Livewire in my main application with app.js

import { Livewire, Alpine } from '../../vendor/livewire/livewire/dist/livewire.esm'
import carbon from './plugins/carbon'
import mapbox from './plugins/mapbox'
import toast from './plugins/toast'
import tooltip from './plugins/tooltip'

import.meta.glob([
    '../images/**',
])

Alpine.plugin(carbon)
Alpine.plugin(mapbox)
Alpine.plugin(toast)
Alpine.plugin(tooltip)

Livewire.start()