auth0 / auth0-react

Auth0 SDK for React Single Page Applications (SPA)
MIT License
891 stars 259 forks source link

Fix Typescript compilation for 4.6.3 #812

Open steaks opened 3 weeks ago

steaks commented 3 weeks ago

By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

Fixes #811. This PR fixes compilation for on Typescript 4.6.3. It still works on 4.9.

I tried the simplest solution - casting the variable to the known type.

References

Include any links supporting this change such as a:

-#811

  • Auth0 Community post
  • StackOverflow post
  • Support forum thread
  • Related pull requests/issues from other repos

If there are no references, simply delete this section.

Testing

  1. Change typescript version to 4.6.3 in package.json
  2. Change moduleResolution to node in tsconfig.json
  3. npm install (may need to clean first)
  4. npx tsc -b
  5. See no compilation errors

Developed on Ubuntu 22.04.5 LTS. Tested in Chrome 129.0.6668.58 (Official Build) (64-bit). Tested in Firefox 131.0.3 (64-bit).

Checklist