Closed nachogrxdev closed 1 month ago
What does your browser console tell you?
What does your browser console tell you?
Does your network tab make a request out to Sentry? Does that fail?
Does your network tab make a request out to Sentry? Does that fail?
Clicking Send Browser test error
Even if you don't have any of the notification receiving buttons
Okay, you might need to inspect your HTML to see if the Sentry SDK is even loaded.
There might be a conflict with another plugin or some optimization plugin causing issues.
You would expect to see: wp-content/plugins/wp-sentry/public/wp-sentry-browser.min.js
being loaded on your page. If that script is not loaded it could explain why there are no other errors or requests visible.
Okay, you might need to inspect your HTML to see if the Sentry SDK is even loaded.
There might be a conflict with another plugin or some optimization plugin causing issues.
You would expect to see:
wp-content/plugins/wp-sentry/public/wp-sentry-browser.min.js
being loaded on your page. If that script is not loaded it could explain why there are no other errors or requests visible.
I currently have all plugins disabled except Sentry.
Inspecting the HTML code of the wordpress sentry configuration page does not find any js loaded with the name wp-sentry-browser.min.js
Interesting. It works like a charm on a few of my installations.
What version of PHP, the plugin and/or WordPress are you using?
And is the installation a network installation or regular.
Anything else that might be different or non-standard that you can think of (maybe a theme)?
Interesting. It works like a charm on a few of my installations.
What version of PHP, the plugin and/or WordPress are you using?
And is the installation a network installation or regular.
Anything else that might be different or non-standard that you can think of (maybe a theme)?
It's a freshly installed wordpress, nothing special.
I'm using a dockerized version image: wordpress:latest
with a reverse proxy with Traefik and the entire network under cloudflare
/var/www/html# php -v
PHP 8.0.30 (cli) (built: Oct 12 2023 05:07:52) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.30, Copyright (c) Zend Technologies
with Zend OPcache v8.0.30, Copyright (c), by Zend Technologies
To clarify, the PHP notification works correctly.
Plugin installed on a WordPress hosted on Dreamhost with PHP 8.1, the integration with JS does not work either.
In this case, I don't see that it has loaded the corresponding .js
either.
The plot thickens, interesting. On what WordPress version are you?
You both don't have WP_SENTRY_BROWSER_ADMIN_ENABLED
defined right?
The plot thickens, interesting. On what WordPress version are you?
You both don't have
WP_SENTRY_BROWSER_ADMIN_ENABLED
defined right?
/* Set Sentry configuration */
// It's possible your WordPress installation is different, check to make sure this path is correct for your installation
require_once __DIR__ . '/wp-content/plugins/wp-sentry-integration/wp-sentry.php';
define('WP_SENTRY_PHP_DSN', 'https://X@X.ingest.us.sentry.io/X');
define('WP_SENTRY_SEND_DEFAULT_PII', true);
define('WP_SENTRY_TRACES_SAMPLE_RATE', 0.7); // traces_sample_rate
define('WP_SENTRY_PROFILES_SAMPLE_RATE', 0.7);
define('WP_SENTRY_BROWSER_DSN', 'https://X@X.ingest.us.sentry.io/X');
define('WP_SENTRY_BROWSER_TRACES_SAMPLE_RATE', 0.7); // tracesSampleRate
// These options are injected into the `Sentry.init()` call
// https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration
define('WP_SENTRY_BROWSER_REPLAYS_SESSION_SAMPLE_RATE', 0.1); // replaysSessionSampleRate
define('WP_SENTRY_BROWSER_REPLAYS_ON_ERROR_SAMPLE_RATE', 1.0); // replaysOnErrorSampleRate
/* That's all, stop editing! Happy publishing. */
This is the configuration of this last Dreamhost environment that I mention. I don't have any definition for the variable commented out by WP_SENTRY_BROWSER_ADMIN_ENABLED
Move your require_once
to AFTER your define
statements π
The issue is that your config is not defined when you are loading Sentry.
However the admin page loads a lot later and thus picks up on the config just fine.
I have to think of a good way to detect this better π€
Move your
require_once
to AFTER yourdefine
statements πThe issue is that your config is not defined when you are loading Sentry.
However the admin page loads a lot later and thus picks up on the config just fine.
I have to think of a good way to detect this better π€
Indeed, now it works. Thank you so much!
For future readers, please make sure you do them in the correct order, (all) configuration first the require_once
next otherwise values might not be picked up correctly.
I'm trying to configure Browser Javascript and I'm getting this error when testing.
Browser failed to send test. Check your configuration to make sure your DSN is set correctly.
I have run the tests incognito without any extension.