Angular 4 monorepo with shared AuthService

Hello,

I am making an Angular Monorepo with multiple SPAs and would like to use a shared AuthService (from the Quickstart Guide) to keep my code DRY. When compiling my shared library I am encountering a large number of errors relating to not finding types. As an example:

ERROR in ../../node_modules/@auth0/auth0-spa-js/dist/typings/Auth0Client.d.ts:11:26 - error TS2304: Cannot find name 'Auth0ClientOptions'.

11     constructor(options: Auth0ClientOptions);

I have found these types in the node_modules folder under '@auth0/auth0-spa-js/dist/typings/global.d.ts' however these are not being imported into Auth0Client.d.ts.

Any help on getting this library up and running would be appreciated.

Hello!

I have the same problem with Angular 8 after I’ve created a shared library and tried to put auth.service.ts and auth.guard.ts files in my shared library. I’m able to build my shared library and install it in my App as a dependency, but after that my App does not build, listing errors related to
../../node_modules/@auth0/auth0-spa-js/dist/typings/Auth0Client.d.ts error TS2304: Cannot find name 'Auth0ClientOptions'

Anyone can help with this?

Thanks :slight_smile:

Ok, looks like I should install the Auth0’s TypeScript definition package using

npm install @types/auth0-spa-js --save

However, this package does not exist. What should I import to make it work?

Maybe @dan.woda could help me for this one as well :slight_smile: