I have the following .d.ts file (extract of it)
declare const Auth0: Auth0Static;
declare module "auth0-js" {
export = Auth0
}
Now in my .ts file I am using the following
import { Auth0 } from 'auth0-js';
I get the following error
auth0-js has no exported member Auth0
Whats going wrong here?
The
auth0-jslibrary does not export anything namedAuth0.If you just want to import everything then change your import to
import * as Auth0 from 'auth0-js'. Otherwise your can import the individual exports likeimport { WebAuth } from 'auth0-js';Also, are you making your own typings? Otherwise you can just use the already available typings from
npm install @types/auth0-js.Make sure your
tsconfig.jsonis configured to lookup the typings: