supertokens-website
supertokens-website copied to clipboard
Fetch interceptor causing error in development when using an ad blocker
When a google ad pixel fires we get the error Uncaught (in promise) TypeError: Failed to fetch if using Adblock Plus extension. I'm using Chrome on mac.
The ad pixel request looks something like this:
fetch("https://some-google-ad-url.com/some-url-slug", {
browsingTopics: true,
keepalive: true
})
The error occurs in recipeImplementation.js here:
I can disable the ad blocker and the problem disappears but this error doesn't occur when not using supertokens so I thought I should report the bug.
EDIT: happens both in development and production
Thanks for raising this issue. We will have a look.
I've started investigating this problem, and I have a few questions:
- Does this cause any issues besides being logged into the console? The
Failed to fetchandBLOCKED_BY_CLIENTexceptions being thrown are the expected behaviour as far as I can see. - Are there errors logged to the console with supertokens disabled?
- Could you add a screenshot of the console contents with and without supertokens?
@porcellus sorry for taking a while to reply.
In development, rather than just a "failed to fetch" error we also get an error popup (we're using nextjs) like this:
The error that is causing problems still gets logged to the console without supertokens but is smaller and doesn't trigger the nextjs error popup. Here are screenshots with and without supertokens initialised:
Hope that helps :)