Inability to capture errors that come from underlying auth0 spa js package

Open
#1,321 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
react, typescript

Research direction

Start by tracing how auth errors from the underlying auth0-spa-js package reach the React SDK, then check the SDK API documentation and existing error handling. The issue asks for a callback to handle those errors; done means the callback can receive them and callers can handle them, with tests covering the behavior. The payload does not identify a source file or test.

Written by the indexing model from the issue text.

Description

auth0-spa-js enhancement
Checklist
Description

I get this error often, the failed to fetch error. I understand that that cannot be solved, however I would like to handle it better then it just being thrown. Ideally for underlying errors there is a callback that we can attach to and handle the error ourselves.

if there is a solution here I am missing feel free to point it out

Error
Failed to fetch
mechanism
generic
handled
true
node_modules/@auth0/auth0-react/node_modules/@auth0/auth0-spa-js/dist/auth0-spa-js.production.esm.js:1:22246
in
o.port1.onmessage
{snip} geChannel;i.port1.onmessage=function(e){e.data.error?o(new Error(e.data.error)):n(e.data),i.port1.close()},t.postMessage(e,[i.port2])}),We=( {snip}
//# sourceMappingURL=auth0-spa-js.production.esm.js.map
Reproduction

this is intermittent and hard to reproduce

Additional context

No response

auth0-react version

2.30.0

React version

19.3.1

Which browsers have you tested in?

Chrome

Dominant language
TypeScript
Stars
992
Forks
292
Avg merge
10h 29m
Merged PRs (30d)
24

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from auth0/auth0-react

All issues in auth0/auth0-react

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.