-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript error in an Angular 9 app with auth0-spa-js #365
Comments
Thanks @Arnaud73. You should be able to do: import createAuth0Client, { Auth0Client } from '@auth0/auth0-spa-js'; To import that type - does that cause the error to go away, or does it remain? |
Same issue for us, syntax above does not work. Our workaround is to set "skipLibCheck": true, in tsconfig.json. We import:
|
Thanks @stevehobbsdev! Bad luck, it does not change a thing. Same error :( For additionnal information, my AuthService is quite similar to the one defined in your documentation (https://auth0.com/docs/quickstart/spa/angular2/01-login). I guess yours, if implemented in a brand new Angular 9 project, will raise the error. |
Thanks @submarines-and, your workaround is working for me. I'm going to stick with |
I'm not sure we're able to fix this particular issue any time soon. The way it has been built so far doesn't play very nicely with mixed default and named exports, so unfortunately we need to get a little bit hacky with the type system. To fix this though will mean a breaking change. This is absolutely something we want to fix in the future when we release a new major version though, and the interface around importing these types will change. Thanks for the tip @submarines-and, if you don't mind I will add this to the FAQ for reference in the future. |
This should be resolved by #367 - which is in the latest beta Can you give v1.7.0-beta.4 a try? |
Seems to be working for me :) |
Description
Using auth0-spa-js in an Angular 9 application results in a Typescript error during compilation.
Reproduction
When auth0-spa-js is used inside a new Angular 9 application, compilation fails with the following error:
Imports are done this way:
Environment
The text was updated successfully, but these errors were encountered: