Closed kachar closed 7 months ago
I also have "Failed to fetch problem"
Solved it by downgrade to "@clerk/nextjs": "4.21.13",
π Hey there @kachar! this is an issue that can happen with bots, but if it's happening with users it's a concern. If it's a bot, we should be able to block the bot as well (cc @anagstef)
Have you seen this error reported by real users or been able to reproduce it in any way? If not, you may be able to mute the error and move on.
@manutzsong - this seems like it is a separate issue, would you be willing to open a new issue to discuss this? Any more details you can provide, or a reproduction would be very useful here too.
I can confirm that this is not a bot issue - we get it on a variety of browsers, and for logged-in users in Sentry:
@jescalan - we are getting a token refresh issue as well. it's a bad issue because the client essentially is locked out from the website and has to change browsers or clear cache. can you please look into this?
It's not acceptable for customers to be dealing with this & I see the same sentry errors as @tmcw . I unfortunately cannot recreate this issue locally.
We'll discuss this one again, but it's quite difficult to look into without any way to reproduce it. Thank you both for the followup!
Hello @Andriy-Kulak,
Are you getting a Token refresh failed ... TypeError: NetworkError ...
or is it another type of token refresh failed issue?
There are multiple token refresh failed errors.
The above error is related to a NetworkError which may be caused by :
ref: https://github.com/JakeChampion/fetch/issues/310
Is it possible to have any of the following information:
cc: @tmcw , @kachar
@dimkl there were no cors errors This is the full error (abstracted our domain). What is HAR? does below help?
Error: ClerkJS: Token refresh failed (error='ClerkJS: Network error at "https://clerk.{ourdomain.com}/v1/client/sessions/sess_2UpTfftYexW5yvzcs9XhVau3uy8/tokens?_clerk_js_version=4.57.0" - TypeError: Failed to fetch. Please try again.')
This is not related to a firefox add on so https://github.com/JakeChampion/fetch/issues/310 doesn't seem related
@Andriy-Kulak the ref
of https://github.com/JakeChampion/fetch/issues/310 was added as a resource link for the causes I mentioned. I'm sorry for the misunderstanding, I didn't intend to indicate that the Firefox add-on was your issue.
Also, you can generate a HAR file following this: https://www.inflectra.com/Support/KnowledgeBase/KB254.aspx
Since you didn't find any CORS or Network related information on your Dev Tools a https://replay.io/ recording would be really helpful to pinpoint the issue.
Hello π
We currently close issues after 40 days of inactivity. It's been 30 days since the last update here. If we missed this issue, please reply here. Otherwise, we'll close this issue in 10 days.
As a friendly reminder: The best way to see an issue fixed is to open a pull request. If you're not sure how to do that, please check out our contributing guide.
Thanks for being a part of the Clerk community! π
hello, I am experiencing this as well running on cloudflare pages togheter with remix. I sometimes get a token and sometimes don't get a token.
There is no pattern to this
Here's an example from production. I had a tab in the background for a bit. Clerk requests a new token twice, then the third time fails, which causes the next time we request resources to fail, and for the page to crash because resources got 401 response codes.
Also experiencing this with nextjs. And like @tmcw 's comment above, it seems to make many requests of which most succeed but the last one fails
I am getting this error with Next.js when I lose my internet connection (e.g. turn off mobile hotspot when travelling)
Hey everyone - we're sorry that this is a frustrating error. We have discussed this as a team on several occasions, it's a generic network error that can happen for a variety of reasons, and is very difficult for us to look into without a way to consistently reproduce it. We're going to leave this issue open for now in case anyone is able to find a way to reproduce, but want to note that we aren't actively working on it.
If anyone is able to produce a reproduction or is aiming to do so, this guide would maybe be helpful - alternately if it can be captured via replay that would be very useful as well.
@jescalan As a developer, I will try to describe how to reproduce as best as I can.
The next few steps are Pure theories, guesses. I suspect one of them is why I have seen this error twice in the last three days.
Next time I encounter this error I will share the HAR file.
I work from several cafe's during the day for fun while coding, and I don't consistently get the error even then, so please remember the above is just my best guesses.
Hello π
We currently close issues after 40 days of inactivity. It's been 30 days since the last update here. If we missed this issue, please reply here. Otherwise, we'll close this issue in 10 days.
As a friendly reminder: The best way to see an issue fixed is to open a pull request. If you're not sure how to do that, please check out our contributing guide.
Thanks for being a part of the Clerk community! π
After 8 days without a reproduction being supplied, we are closing this issue. Keep in mind, I'm just a robot, so if I've closed this issue in error, please reply here and my human colleagues will reopen it. Likewise if a reproduction is prepared after it has been closed.
Hey - Did anyone in here get to the bottom of this?
I agree with @saahirfoux that it's a timeout of sorts. If I leave a browser tab open and come back a few hours later there is an error waiting for me Error: ClerkJS: Token refresh failed (error='Cannot read properties of null (reading 'jwt')')
I understand it's hard to replicate to fix but can you give any guidance on how I can catch it?
Hey @jescalan , I'm seeing this error quite a bit in my app. The app is pay walled so I'm confident that these are real users (not bots).
Not sure if this helps but it looks like the error is origination from /npm/@clerk/clerk-js@4/dist/clerk.browser.js
The error is
ClerkJS: Token refresh failed (error='ClerkJS: Network error at "https://clerk.fapchallenger.com/v1/client/sessions/sess_<id...>/tokens?_clerk_js_version=4.72.1" - TypeError: Failed to fetch. Please try again.')
I currently only have one session reply but it happens about 2 min and 20 seconds after the user verifies their email after creating the account.
Package + Version
@clerk/clerk-js
@clerk/clerk-react
@clerk/nextjs
-4.23.2
@clerk/remix
@clerk/types
-3.49.0
@clerk/themes
-1.7.5
@clerk/localizations
@clerk/clerk-expo
@clerk/backend
-0.27.0
@clerk/clerk-sdk-node
@clerk/shared
@clerk/fastify
@clerk/chrome-extension
gatsby-plugin-clerk
build/tooling/chore
Dependencies + versions
Provide a json with the dependencies used in your project (copy paste from yarn.lock / package-lock.json) or a github project / template that reproduces the issue.
*Include the @clerk/ packages and their versions!**
Example:
Browser/OS
If applicable e.g.
Chrome {version}
,Node {version}
,Bun {version}
,Cloudflare worker {version}
Description
We're experiencing a severe number of errors reported by Sentry regarding the Clerk user authentication. It happens ad-hoc and between releases.
Is there anything we can do to improve this process and reduce the errors for our customers?