Skip to content

ClerkJS: Token refresh failed. TypeError: Failed to fetch. Please try again. #1616

@kachar

Description

@kachar
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_Y2xlcmsudGVhbS1ncHQuY29tJA

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
  • other:

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:

{  
  "dependencies": {
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "next": "13.4.16",
    "axios": "^1.4.0",
    "@clerk/backend": "0.27.0",
    "@clerk/nextjs": "^4.23.2",
    "@clerk/themes": "1.7.5",
    "@clerk/types": "3.49.0",
    "@sentry/core": "^7.64.0",
    "@sentry/nextjs": "^7.64.0",
    "@sentry/node": "^7.64.0",
    "@sentry/profiling-node": "^1.1.2",
    "@sentry/utils": "^7.64.0"
  }
}

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.

Error
ClerkJS: Token refresh failed (error='ClerkJS: Network error at "https://clerk.our-domain.com/v1/client/sessions/sess_2TwhWEx3j9IvWXU0qOtEwutNLx2/tokens?_clerk_js_version=4.53.0" - TypeError: Failed to fetch. Please try again.')

image

Is there anything we can do to improve this process and reduce the errors for our customers?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions