# Angular 10 SPA Error on redirect after login: there are no query params available for parsing

**URL:** <https://community.auth0.com/t/angular-10-spa-error-on-redirect-after-login-there-are-no-query-params-available-for-parsing/57805>\
**Category:** Get Help\
**Tags:** bug, angular, auth0, login\
**Created:** [February 13, 2021, 1:18am UTC](https://community.auth0.com/t/angular-10-spa-error-on-redirect-after-login-there-are-no-query-params-available-for-parsing/57805 "2021-02-13T01:18:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stormtalons](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stormtalons/32/20251_2.png) [@Stormtalons](https://community.auth0.com/u/Stormtalons)\
**Post date:** [February 13, 2021, 1:18am UTC](https://community.auth0.com/t/angular-10-spa-error-on-redirect-after-login-there-are-no-query-params-available-for-parsing/57805/1 "2021-02-13T01:18:28Z")

</div>

I have an Angular 10 app using Auth0 that suddenly stopped working today. Around noon I could log in successfully, but in the midafternoon I started getting this error upon returning from a successful login. I know they are successful because I can see them in the logs in my dashboard.

I saw the other thread with a similar error from Aug '19, but I’ve confirmed with logs that the redirect callback is only being made once. I also reverted my site code to a version from weeks ago, when I know for certain the integration was working, and I am still receiving this same error. This makes me think the issue is on the Auth0 service side, but the service status page shows no interruptions, so I am open to anything… is this a known issue? What can be done to fix it? Please let me know if I can provide any additional information or context.

core.js:4442 ERROR Error: There are no query params available for parsing.  
at e. (auth0-spa-js.production.esm.js:15)  
at auth0-spa-js.production.esm.js:15  
at Object.next (auth0-spa-js.production.esm.js:15)  
at auth0-spa-js.production.esm.js:15  
at new ZoneAwarePromise (zone-evergreen.js:960)  
at r (auth0-spa-js.production.esm.js:15)  
at e.handleRedirectCallback (auth0-spa-js.production.esm.js:15)  
at MergeMapSubscriber.project (auth.service.ts:35)  
at MergeMapSubscriber.\_tryNext (mergeMap.js:46)  
at MergeMapSubscriber.\_next (mergeMap.js:36)  
defaultErrorLogger @ core.js:4442  
handleError @ core.js:4490  
next @ core.js:28096  
schedulerFn @ core.js:24910  
\_\_tryOrUnsub @ Subscriber.js:183  
next @ Subscriber.js:122  
\_next @ Subscriber.js:72  
next @ Subscriber.js:49  
next @ Subject.js:39  
emit @ core.js:24900  
(anonymous) @ core.js:27568  
invoke @ zone-evergreen.js:364  
run @ zone-evergreen.js:123  
runOutsideAngular @ core.js:27472  
onHandleError @ core.js:27568  
handleError @ zone-evergreen.js:368  
runTask @ zone-evergreen.js:170  
invokeTask @ zone-evergreen.js:480  
ZoneTask.invoke @ zone-evergreen.js:469  
timer @ zone-evergreen.js:2552  
setTimeout (async)   
scheduleTask @ zone-evergreen.js:2573  
scheduleTask @ zone-evergreen.js:385  
onScheduleTask @ zone-evergreen.js:272  
scheduleTask @ zone-evergreen.js:378  
scheduleTask @ zone-evergreen.js:210  
scheduleMacroTask @ zone-evergreen.js:233  
scheduleMacroTaskWithCurrentZone @ zone-evergreen.js:1134  
(anonymous) @ zone-evergreen.js:2586  
proto. @ zone-evergreen.js:1449  
hostReportError @ hostReportError.js:2  
error @ Subscriber.js:156  
\_error @ Subscriber.js:75  
error @ Subscriber.js:55  
\_error @ Subscriber.js:75  
error @ Subscriber.js:55  
\_error @ tap.js:56  
error @ Subscriber.js:55  
notifyError @ OuterSubscriber.js:7  
\_error @ InnerSubscriber.js:14  
error @ Subscriber.js:55  
(anonymous) @ subscribeToPromise.js:8  
invoke @ zone-evergreen.js:364  
onInvoke @ core.js:27545  
invoke @ zone-evergreen.js:363  
run @ zone-evergreen.js:123  
(anonymous) @ zone-evergreen.js:857  
invokeTask @ zone-evergreen.js:399  
onInvokeTask @ core.js:27533  
invokeTask @ zone-evergreen.js:398  
runTask @ zone-evergreen.js:167  
drainMicroTaskQueue @ zone-evergreen.js:569  
Promise.then (async)   
scheduleMicroTask @ zone-evergreen.js:552  
scheduleTask @ zone-evergreen.js:388  
scheduleTask @ zone-evergreen.js:210  
scheduleMicroTask @ zone-evergreen.js:230  
scheduleResolveOrReject @ zone-evergreen.js:847  
then @ zone-evergreen.js:979  
bootstrapModule @ core.js:28133  
zUnb @ main.ts:11  
**webpack\_require** @ bootstrap:79  
0 @ comment-filter.pipe.ts:6  
**webpack\_require** @ bootstrap:79  
checkDeferredModules @ bootstrap:45  
webpackJsonpCallback @ bootstrap:32  
(anonymous) @ main.js:1

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [February 17, 2021, 1:39pm UTC](https://community.auth0.com/t/angular-10-spa-error-on-redirect-after-login-there-are-no-query-params-available-for-parsing/57805/3 "2021-02-17T13:39:03Z")

</div>

Hi @Stormtalons,

Welcome to the Community!

Since it sounds like the behavior changed without altering the code, I’m wondering if this is a race condition related to when the `handleRedirectCallback` fn runs. You may have already tried this, but if you add a breakpoint somewhere before that function is called, is it running at some point when the `code` and `state` query param isn’t available in the URL (maybe due to another redirect)?

---

<div class="post-metadata">

**Author:** ![Stormtalons](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stormtalons/32/20251_2.png) [@Stormtalons](https://community.auth0.com/u/Stormtalons)\
**Post date:** [February 18, 2021, 4:08am UTC](https://community.auth0.com/t/angular-10-spa-error-on-redirect-after-login-there-are-no-query-params-available-for-parsing/57805/4 "2021-02-18T04:08:44Z")

</div>

Hi Stephanie, thank you very much for the reply.

I am newish to web development, so I had not tried setting a breakpoint (or even knew how, in javascript) before your suggestion. What I found is that when this callback is being made, it does seem like the parameters are populated in the URL. See [here](https://imgur.com/sxRMbAW). If I hit continue at that point, [I will land back at my home page, but without the parameters visible in the URL](https://imgur.com/84sLO5T), with the error, and without this breakpoint having been hit again. [I do not see any additional redirects being made](https://imgur.com/dHU3I0s).

Do you have any suggestions for further troubleshooting?

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [February 18, 2021, 1:00pm UTC](https://community.auth0.com/t/angular-10-spa-error-on-redirect-after-login-there-are-no-query-params-available-for-parsing/57805/5 "2021-02-18T13:00:04Z")

</div>

Thanks for sending the screenshots! Based on those, it does seem like `handleRedirectCallback` is called when there are query params. Still, I’m wondering if it does not complete because of the redirect back to home since `handleRedirectCallback` is an async function.

Does your Angular Router contain a redirect (`redirectTo`)? If so, you could try removing it.

This topic is for an Angular 9 app, but may be helpful: [Angular 9 application with Auth0 keeps on redirecting after successful login in Firefox - #8 by kphay-11](https://community.auth0.com/t/angular-9-application-with-auth0-keeps-on-redirecting-after-successful-login-in-firefox/41394/8)

You could try passing the URL to `handleRedirectCallback` like in the solution.

Also, are you using [auth0-angular](https://auth0.com/docs/quickstart/spa/angular/01-login) or another Auth0 SDK? Also, which version?

---

<div class="post-metadata">

**Author:** ![Stormtalons](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stormtalons/32/20251_2.png) [@Stormtalons](https://community.auth0.com/u/Stormtalons)\
**Post date:** [February 19, 2021, 6:33am UTC](https://community.auth0.com/t/angular-10-spa-error-on-redirect-after-login-there-are-no-query-params-available-for-parsing/57805/6 "2021-02-19T06:33:41Z")

</div>

Thank you for linking that thread… [kphay-11](https://community.auth0.com/u/kphay-11)’s solution resolved my issue. I didn’t need the delay, but saving the URL and passing it back into client.handleRedirectCallback got rid of the error for me.

I am still left confused how/why this was working at all before and why it chose now to break, but some mysteries go unsolved I guess. Thank you so much for your help!

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [February 19, 2021, 11:24am UTC](https://community.auth0.com/t/angular-10-spa-error-on-redirect-after-login-there-are-no-query-params-available-for-parsing/57805/7 "2021-02-19T11:24:10Z")

</div>

Awesome! Glad the topic helped!

Could be because `handleRedirectCallback` is async, but that it is odd how it was consistently working, and then it was consistently failing 🤔.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 6, 2021, 11:25am UTC](https://community.auth0.com/t/angular-10-spa-error-on-redirect-after-login-there-are-no-query-params-available-for-parsing/57805/8 "2021-03-06T11:25:07Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
