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
Clone auth0-react
Change typescript version to 4.6.3 in package.json
Change moduleResolution to node in tsconfig.json
npm install
npx tsc -b
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.
Checklist
Description
My project uses Typescript 4.6.3. This library fails to compile with these errors.
Reproduction
Additional context
No response
auth0-react version
2.2.1
React version
17.0.2
Which browsers have you tested in?
Other