supertokens-website icon indicating copy to clipboard operation
supertokens-website copied to clipboard

Fetch interceptor causing error in development when using an ad blocker

Open meandillar opened this issue 2 years ago • 3 comments

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:

Screenshot 2023-05-26 at 8 14 58 AM

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

meandillar avatar May 25 '23 20:05 meandillar

Thanks for raising this issue. We will have a look.

rishabhpoddar avatar May 26 '23 05:05 rishabhpoddar

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 fetch and BLOCKED_BY_CLIENT exceptions 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 avatar Jun 01 '23 23:06 porcellus

@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:

Screenshot 2023-07-04 at 2 09 33 PM

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:

Screenshot 2023-07-04 at 2 10 15 PM Screenshot 2023-07-04 at 2 11 34 PM

Hope that helps :)

meandillar avatar Jul 04 '23 02:07 meandillar