Auth0.js: Could not find a declaration file for module 'auth0-js'.

Created on 24 Aug 2017  Â·  7Comments  Â·  Source: auth0/auth0.js

In my package.json I have the following:
"auth0-js": "^8.9.3",
Using the provided example in https://auth0.com/docs/quickstart/spa/angular2/01-login I am including the module in auth.service.ts like this:
import * as auth0 from 'auth0-js';
After install, the module is correctly placed under node_modules however I get this error message when running npm start:

src/app/auth/auth.service.ts(4,24): error TS7016: Could not find a declaration file for module 'auth0-js'.
I am using Angular2 for this app with windows 10 if that matters.

Most helpful comment

We don't ship the definition files ourselves, so I think you have to install them
npm install --save @types/auth0-js

All 7 comments

We don't ship the definition files ourselves, so I think you have to install them
npm install --save @types/auth0-js

I don't know exactly what is a definition file but you should definitely supply it, the example does not work without it. Anyway after installing that it is still not working.

Definition files are typescript specific files. More about them here.

I just cloned the example you gave me and run it. It works. You probably have something wrong in your project.

image

Thanks for you support, I made it work. You guys rock.

On 24 Aug 2017 16:49, "Luís Rudge" notifications@github.com wrote:

Definition files are typescript specific files. More about them here
https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html
.

I just cloned the example you gave me and run it. It works. You probably
have something wrong in your project.

[image: image]
https://user-images.githubusercontent.com/941075/29675051-5fbe8ebc-88ca-11e7-9b98-d303484a115f.png

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/auth0/auth0.js/issues/496#issuecomment-324676346, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABIinRXpClAcR5F-0-iWYRyMDqKW1lHDks5sbZtugaJpZM4PBM62
.

@sh4ka , can you advice what was the reason an solution for this issue, - I have this right now on my project, can not get rid of this error "TS7016: Could not find a declaration file for module 'auth0-js'"

Thanks,

@Electromaxim You need the type declaration file as mentioned above.

im using auth0-js in react and getting the react equivalent of what is being described above, anybody have an idea for how i solve this issue?

Was this page helpful?
0 / 5 - 0 ratings