Skip to content
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

Sign-In Widget doesn't work out-of-the-box when using Angular strict mode #29

Open
mraible opened this issue Mar 30, 2021 · 2 comments
Open

Comments

@mraible
Copy link
Contributor

mraible commented Mar 30, 2021

When I create an Angular 11 app in strict-mode, importing the Sign-In Widget doesn't work.

Error: src/app/login/login.component.ts:6:24 - error TS7016: Could not find a declaration file for module '@okta/okta-signin-widget'. '/Users/mraible/AngularCalculator/node_modules/@okta/okta-signin-widget/dist/js/okta-sign-in.entry.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/okta__okta-signin-widget` if it exists or add a new declaration (.d.ts) file containing `declare module '@okta/okta-signin-widget';`

6 import OktaSignIn from '@okta/okta-signin-widget';
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~

If I create a src/sign-in-widget.d.ts file with the following contents, it works.

declare module '@okta/okta-signin-widget';

I'm creating this issue so we can document this problem in the README. Or better yet, fix it!

@denysoblohin-okta
Copy link
Collaborator

Thanks for submitting this issue.
PR for adding declaration file for okta-signin-widget is under review, will be available soon.
okta/okta-signin-widget#1740

@mraible
Copy link
Contributor Author

mraible commented Mar 30, 2021

FWIW, I discovered this issue while updating our blog post on Angular Login.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants