morrislaptop / laravel-pulse-4xx

Laravel Pulse Card for 4XX responses like validation, auth and not found

Home Page:https://packagist.org/packages/morrislaptop/laravel-pulse-4xx

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Other cards don't load when included

johnbacon opened this issue · comments

What happened?

When installing and then including in the view file via <livewire:4xx cols='4' rows='2' />, no other cards load.

Console error: Uncaught (in promise) Could not find Livewire component in DOM tree

image

How to reproduce the bug

  • Install package
  • Attempt to output on page

Package Version

0.0.2

PHP Version

8.1.11

Laravel Version

10.35.0

Which operating systems does with happen with?

Linux

Notes

Using the latest commit in the Pulse beta: laravel/pulse@9c65d50

Here is the query:

select (select `key` from `pulse_entries` as `keys` where `keys`.`key_hash` = `aggregated`.`key_hash` limit 1) as `key`, `max`, `count` from (select `key_hash`, max(`max`) as `max`, sum(`count`) as `count` from ((select `key_hash`, max(`value`) as `max`, count(*) as `count` from `pulse_entries` where `type` = '4xx_request' and `timestamp` >= 1702650835 and `timestamp` <= 1702650839 group by `key_hash`) union all (select `key_hash`, max(`value`) as `max`, null as `count` from `pulse_aggregates` where `period` = 60 and `type` = '4xx_request' and `aggregate` = 'max' and `bucket` >= 1702650840 group by `key_hash`) union all (select `key_hash`, null as `max`, sum(`value`) as `count` from `pulse_aggregates` where `period` = 60 and `type` = '4xx_request' and `aggregate` = 'count' and `bucket` >= 1702650840 group by `key_hash`)) as `results` group by `key_hash` order by `count` desc limit 101) as `aggregated`

And the dump() output of $fourXxRequests:

Illuminate\Support\Collection {#953 ▼ // vendor/morrislaptop/laravel-pulse-4xx/src/FourXxCard.php:54
  #items: array:2 [▼
    0 => {#936 ▼
      +"method": "GET"
      +"uri": "test/pulse"
      +"status": 403
      +"latest": Carbon\CarbonImmutable @1702654384 {#947 ▼
        #endOfTime: false
        #startOfTime: false
        #constructedObjectId: "00000000000003b30000000000000000"
        #localMonthsOverflow: null
        #localYearsOverflow: null
        #localStrictModeEnabled: null
        #localHumanDiffOptions: null
        #localToStringFormat: null
        #localSerializer: null
        #localMacros: null
        #localGenericMacros: null
        #localFormatFunction: null
        #localTranslator: null
        #dumpProperties: array:3 [▶]
        #dumpLocale: null
        #dumpDateProperties: null
        date: 2023-12-15 10:33:04.0 America/New_York (-05:00)
      }
      +"count": "9.00"
    }
    1 => {#949 ▼
      +"method": "GET"
      +"uri": "test/asodjfaiodsf"
      +"status": 404
      +"latest": Carbon\CarbonImmutable @1702655662 {#954 ▼
        #endOfTime: false
        #startOfTime: false
        #constructedObjectId: "00000000000003ba0000000000000000"
        #localMonthsOverflow: null
        #localYearsOverflow: null
        #localStrictModeEnabled: null
        #localHumanDiffOptions: null
        #localToStringFormat: null
        #localSerializer: null
        #localMacros: null
        #localGenericMacros: null
        #localFormatFunction: null
        #localTranslator: null
        #dumpProperties: array:3 [▶]
        #dumpLocale: null
        #dumpDateProperties: null
        date: 2023-12-15 10:54:22.0 America/New_York (-05:00)
      }
      +"count": "1.00"
    }
  ]
  #escapeWhenCastingToString: false
}

I couldn't replicate this I'm afraid... could you get a failing test working? FourXXCardTest.php would be a good start.

image