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

Typescript compilation error #811

Open
6 tasks done
steaks opened this issue Oct 21, 2024 · 0 comments · May be fixed by #812
Open
6 tasks done

Typescript compilation error #811

steaks opened this issue Oct 21, 2024 · 0 comments · May be fixed by #812
Labels
bug Something isn't working

Comments

@steaks
Copy link

steaks commented Oct 21, 2024

Checklist

Description

My project uses Typescript 4.6.3. This library fails to compile with these errors.

node_modules/@auth0/auth0-react/src/utils.tsx:22:20 - error TS2339: Property 'error' does not exist on type 'object'.

22       typeof error.error === 'string'
                      ~~~~~

node_modules/@auth0/auth0-react/src/utils.tsx:26:22 - error TS2339: Property 'error_description' does not exist on type 'object'.

26         typeof error.error_description === 'string'
                        ~~~~~~~~~~~~~~~~~

node_modules/@auth0/auth0-react/src/utils.tsx:28:37 - error TS2339: Property 'error' does not exist on type 'object'.

28         return new OAuthError(error.error, error.error_description);
                                       ~~~~~

node_modules/@auth0/auth0-react/src/utils.tsx:28:50 - error TS2339: Property 'error_description' does not exist on type 'object'.

28         return new OAuthError(error.error, error.error_description);
                                                    ~~~~~~~~~~~~~~~~~

node_modules/@auth0/auth0-react/src/utils.tsx:30:35 - error TS2339: Property 'error' does not exist on type 'object'.

30       return new OAuthError(error.error);

Reproduction

  1. Clone auth0-react
  2. Change typescript version to 4.6.3 in package.json
  3. Change moduleResolution to node in tsconfig.json
  4. npm install
  5. npx tsc -b
  6. See errors
src/utils.tsx:22:20 - error TS2339: Property 'error' does not exist on type 'object'.

22       typeof error.error === 'string'
                      ~~~~~

src/utils.tsx:26:22 - error TS2339: Property 'error_description' does not exist on type 'object'.

26         typeof error.error_description === 'string'
                        ~~~~~~~~~~~~~~~~~

src/utils.tsx:28:37 - error TS2339: Property 'error' does not exist on type 'object'.

28         return new OAuthError(error.error, error.error_description);
                                       ~~~~~

src/utils.tsx:28:50 - error TS2339: Property 'error_description' does not exist on type 'object'.

28         return new OAuthError(error.error, error.error_description);
                                                    ~~~~~~~~~~~~~~~~~

src/utils.tsx:30:35 - error TS2339: Property 'error' does not exist on type 'object'.

30       return new OAuthError(error.error);
                                     ~~~~~


Found 5 errors.

Additional context

No response

auth0-react version

2.2.1

React version

17.0.2

Which browsers have you tested in?

Other

@steaks steaks added the bug Something isn't working label Oct 21, 2024
@steaks steaks linked a pull request Oct 21, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant