Auth0 Home Blog Docs

Invalid state when building Angular app for prod

Hi.

We have a very strange error – when our Angular app is built using JIT compilation everything works as expected. When I build using AOT compilation, all logins fail with the message Invalid State. I’ve checked all of our config and we’re using factories for everything and all values seem to be correct. In addition, I see a cookie set in the app and the long string matches the code prop that comes back in the redirect.

Does anyone have any idea what could be causing this issue?

Thanks,
Matt

For anyone else that encounters this, it actually was an issue with SPA.js and after upgrading that library, everything appears to be fine.