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

dist\typings causing compile error with TypeScript #713

Closed
kachihro opened this issue Mar 3, 2021 · 0 comments · Fixed by #714
Closed

dist\typings causing compile error with TypeScript #713

kachihro opened this issue Mar 3, 2021 · 0 comments · Fixed by #714
Labels
bug report This issue reports a suspect bug or issue with the SDK itself

Comments

@kachihro
Copy link
Contributor

kachihro commented Mar 3, 2021

Describe the problem

We're building a webpart for SharePoint 2016, and the older SPFX component framework has to use TypeScript 2.2.
I've been able to use the 'Auth0-spa-js' library for the more recent SPFX (up-to-date TypeScript).

But - have to instead use the older one.

Within the typings/Auth0Client.d.ts file, there is an error that's causing a compiler error - on older TypeScript.

Between v1.6.5 and v1.7.0, this was changed ...>

  • OLD >
    getIdTokenClaims(options?: GetIdTokenClaimsOptions): Promise<IdToken>;

  • NEW >
    getIdTokenClaims(options?: GetIdTokenClaimsOptions): Promise<import("./global").IdToken>;

If I change the TYPINGS file (manually) - then it works.

Otherwise ;

Error - typescript - node_modules@auth0\auth0-spa-js\dist\typings\Auth0Client.d.ts(64,31): error TS1005: ',' expected.
Error - typescript - node_modules@auth0\auth0-spa-js\dist\typings\Auth0Client.d.ts(74,65): error TS1005: '>' expected.
Error - typescript - node_modules@auth0\auth0-spa-js\dist\typings\Auth0Client.d.ts(74,72): error TS1138: Parameter declaration expected.
Error - typescript - node_modules@auth0\auth0-spa-js\dist\typings\Auth0Client.d.ts(74,82): error TS1005: ';' expected.
Error - typescript - node_modules@auth0\auth0-spa-js\dist\typings\Auth0Client.d.ts(74,83): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
Error - typescript - node_modules@auth0\auth0-spa-js\dist\typings\Auth0Client.d.ts(74,91): error TS1005: '=' expected.
Error - typescript - node_modules@auth0\auth0-spa-js\dist\typings\Auth0Client.d.ts(74,92): error TS1109: Expression expected.
Error - 'typescript' sub task errored after 910 ms
"TypeScript error(s) occurred."

Environment

Please provide the following:

  • **Version of auth0-spa-js used: v.16.5 - and v.1.7.0

  • (have a working example in code - w/ v1.13.5 - after I manually change the TYPINGS file)

  • Which framework are you using, if applicable (Angular, React, etc):

  • SPFX v1.1

@kachihro kachihro added the bug report This issue reports a suspect bug or issue with the SDK itself label Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report This issue reports a suspect bug or issue with the SDK itself
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant