Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Sentry.thirdPartyErrorFilterIntegration is not a function #13297

Closed
3 tasks done
hamiltonskraba opened this issue Aug 9, 2024 · 5 comments · Fixed by getsentry/sentry-docs#11053
Closed
3 tasks done

Comments

@hamiltonskraba
Copy link

hamiltonskraba commented Aug 9, 2024

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

Sentry Browser Loader

SDK Version

8.x.0

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

			// Configure sentryOnLoad before adding the Loader Script
			window.sentryOnLoad = function() {
					Sentry.init({
							dsn: '{{ config('sentry-browser.public_dsn') }}',
							environment: {!! json_encode(App::environment()) !!},
							integrations: [
									Sentry.captureConsoleIntegration({
											levels: ['warn', 'error']
									}),
									Sentry.thirdPartyErrorFilterIntegration({
											filterKeys: ['am-web-filter-key'],
											behaviour: 'apply-tag-if-contains-third-party-frames',
									}),
							],
							beforeSend(event) {
									if (!event?.message) return event;

									const isIgnoredMessage = consoleIgnores.some(ignore => event
											.message.includes(ignore));

									return isIgnoredMessage ? null : event;
							},
							denyUrls: [
									//redacted
							],
							ignoreErrors: [
									//redacted
							],
					});

					Sentry.lazyLoadIntegration("captureConsoleIntegration").then(
							(integration) => {
									Sentry.addIntegration(integration());
							},
					);
			};
	</script>

Steps to Reproduce

  • Updated script loader in web app to 8.x.0
  • Included thirdPartyErrorFilterIntegration config
  • Ensured app key defined in vite config

Expected Result

thirdPartyErrorFilterIntegration should work

Actual Result

browser console errors: Sentry.thirdPartyErrorFilterIntegration is not a function

Contacted support; they informed me that the bundle containing the feature hasn't been created yet and suggested creating a ticket here

@lforst
Copy link
Member

lforst commented Aug 12, 2024

Hi, generally it would make sense to export this integration, however it will likely not work with our loader. The integration filters based on "marked" events, and since the loader is not marked by the vite plugin, it would drop (or tag) all events that includes stack frames with the loader script in it - which very likely would be almost all of them because the SDK wraps a lot of functions. We will document that the loader script doesn't support the integration though.

@lforst
Copy link
Member

lforst commented Aug 12, 2024

@navin-moorthy
Copy link

navin-moorthy commented Aug 12, 2024

@lforst, how can we enable this if not using Loader SDK or CDN? NPM install?

Docs says that it's available using Browser based SDK.

Image

@lforst
Copy link
Member

lforst commented Aug 12, 2024

Correct, if you install (and use!) the SDK exclusively via npm (and not via the CDN!), you can use it as the docs describe. Don't mix npm and the CDN though. The integration will not work with the CDN or loader.

@navin-moorthy
Copy link

Got it thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
3 participants