I installed @okta/okta-react
package in my application but it threw the following error?
Could not find a declaration file for module '@okta/okta-react'.
'.../node_modules/@okta/okta-react/dist/index.js' implicitly has an 'any' type.
Try `npm install @types/okta__okta-react` if it exists or add a new declaration (.d.ts)
file containing `declare module '@okta/okta-react';`ts(7016)
How to fix this error?
What I tried?
I checked this blog. I tried to implement this solution but my app does not have tsconfig.json.
EDIT 1:
I tried to install @types/okta__okta-react
but got this error:
$ npm install @types/okta__okta-react
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@types%2fokta__okta-react - Not found
npm ERR! 404
npm ERR! 404 '@types/okta__okta-react@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
Seems like they do not have types yet. You will need to follow devs advice here https://github.com/okta/okta-oidc-js/issues/66#issuecomment-394574326