Cannot find name Auth0Lock


I followed the very helpful tutorial on Ionic 2 and Auth0 here:

However, I am getting an error: Cannot find Auth0Lock in auth.ts

I do have the “declare var Auth0Lock: any;” that should prevent this, but it doesn’t seem to work.

Any ideas?


With Ionic 2 which is recommended ES6 ? or TypeScript?
Getting syntext error while define a class with private member

Same here… I contacted AuthO about it and received following response:

Hi Matt,

We are working on fixing this issue.

In the mean time I can provide you a work around to get the seed project.

Link to the repo,

You would have to configure your credentials (Client-secret and client-id) in app/services/auth/auth.ts

Let us know if you have any more questions.


Vikas Jayaram.
Developer Success Engineer


Double-check if you added the Auth0 script in index.html.

Otherwise you can try to install the Auth0 definitions:

typings install auth0.lock --ambient --save

NOTE: If you don’t have typings installed then you have to install it first:

npm install typings -g


Thanks for the thoughts. Yes, I did add the script to index.html

And also tried the repo mentioned above, but didn’t work correctly.

It appears that Ionic 2 is still in flux, so the auth0 has to respond to a lot of the changes. Hopefully a fix comes out soon



Would like to see working auth example



Has anybody found a workaround for this already?


Try these two lines below the import statements in the auth.service.ts file.

declare var Auth0: any;
declare var Auth0Lock: any;