born05 / craft-sentry

Pushes Craft CMS errors to Sentry.
MIT License
10 stars 11 forks source link

Updating from 2.0.1 to 3.0.0 leads to "missing clientKey" error #33

Closed Mixxey closed 4 months ago

Mixxey commented 4 months ago

Hi everyone,

I don't know if this is a bug or if I'm doing something wrong, but this is what happens:

I ran CMS updates for my Craft 4 installation and updated Sentry SDK from version 2.0.1 to the lates 3.0.0. Now whenever I try to display an entry, I see the following error message:

"Failed to register Sentry browser client due to missing clientKey"

image

Adding "clientKey" to /config/sentry-sdk.php and setting it to an empty string seems to help, as it removes the error while errors still get logged to sentry. But since I'm not quite sure if this is a valid solution, I'm posting here anyway, hoping for some advice.

Many thanks in advance :)

Best regards, Tina

roelvanhintum commented 4 months ago

@Mixxey, it looks like you have reportJsErrors enabled, maybe by accident, which requires the clientKey to function. Setting reportJsErrors to false should solve this, if you don't want sentry to load in the browser. This is because of the latest javascript version: https://docs.sentry.io/platforms/javascript/

Mixxey commented 4 months ago

Thanks a lot for getting back :) That helped, and I found and fixed another problem on my side. Everything works fine now :)