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

Getting Auth0 is not a constructor #66

Closed
Alekzv9 opened this issue Jan 18, 2017 · 9 comments
Closed

Getting Auth0 is not a constructor #66

Alekzv9 opened this issue Jan 18, 2017 · 9 comments

Comments

@Alekzv9
Copy link

Alekzv9 commented Jan 18, 2017

Hi friend,

I clone the repo a install the dependecies, but when I try to run it I get this error:

Error in ./AppComponent class AppComponent - inline template:0:0 caused by: Auth0 is not a constructor

image

Any Idea?

@TwanoO67
Copy link
Owner

hello

what is you ng --version ?

I got it working well with:

angular-cli: 1.0.0-beta.26
node: 7.2.0
os: linux x64
@angular/core: 2.4.4

@AlanAlbuquerque
Copy link

Hi, I had the same issue, I fixed it like this...

1 - change the version of auth0-lock to 10.2.2.

2 - If you have another error with AlertModule (as I have) and DatepickerModule open /src/app/app.module.ts and change the line:

let modules = [
AlertModule,
DatepickerModule,
...

To :

let modules = [
AlertModule.forRoot(),
DatepickerModule.forRoot(),
...

I had a problem with firebase and I had to manually install it.

My computer is in the officer, I put my version informations on monday.

Sorry for bad English. xD

@AlanAlbuquerque
Copy link

angular-cli: 1.0.0-beta.26
node: 7.4.0
os: linux x64
@angular/core: 2.4.4
@angular/compiler: 2.4.4
@angular/common: 2.4.4
@angular/platform-browser: 2.4.4
@angular/platform-browser-dynamic: 2.4.4
@angular/http: 2.4.4

@TwanoO67
Copy link
Owner

The firebase problem has been fixed

But the .forRoot fix doesn't thing to be required...

You still have a problem getting that working ? @AlanAlbuquerque

This was referenced Jan 24, 2017
@TwanoO67
Copy link
Owner

TwanoO67 commented Jan 24, 2017

It seems related to https://auth0.com/forum/t/authlock-is-not-a-constructor/3296/8

Could someone try:
import Auth0Lock from 'auth0-lock'

Instead of the require in auth.service.ts ?

(I still can't reproduce the issue so I can't fix...)

@michaelarnauts
Copy link

By importing only Auth0Lock from auth0-lock, Auth0 itself is still not defined, but it's used here https://github.com/TwanoO67/ng2-admin-lte/blob/master/src/app/services/auth.service.ts#L16

There doesn't seem to be a Auth0 object that can be imported.

I've just cloned this repo and executed npm install and npm start. I'm running node 4.2.6.

@dantavo
Copy link

dantavo commented Jan 24, 2017

@TwanoO67 if I insert import { Auth0Lock } from 'auth0-lock'; in auth service I have this message:
Module '"auth0-lock"' has no exported member 'Auth0Lock' probably I have to install another version of auth0-lock library?

@TwanoO67
Copy link
Owner

I fixed the auth0lock library to the good one.
Delete your node_modules and npm install

BTW... as I don't personnaly use auth0 I'm looking someone to upgrade to the latest library (maybe @cindoum ? ), and maintain this part of code.
If there's no-one interrested in a reasonable time I will replace the login page for a more "standard" one, using an home made server example.
(that would be easier for begginers to modify by their own authentification logick)

@dantavo
Copy link

dantavo commented Jan 24, 2017

perfect now is time to understand how customize it ;)
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants