abacritt / angularx-social-login

Social login and authentication module for Angular 17
641 stars 388 forks source link

Metadata version mismatch for module angularx-social-login.d.ts, found version 4, expected 3 #64

Closed Gnorro closed 6 years ago

Gnorro commented 6 years ago

Hi all

I don't understand if i have to install angular4-social-login or angularx-social-login

Here: https://github.com/abacritt/angularx-social-login under "Import the module" i see

import { SocialLoginModule, AuthServiceConfig } from "angular4-social-login";
import { GoogleLoginProvider, FacebookLoginProvider } from "angular4-social-login";

but then

import { AuthService } from "angularx-social-login";
import { FacebookLoginProvider, GoogleLoginProvider } from "angularx-social-login";

Which is the right one? I ask because after uninstalling angular4-social-login and installing angularx-social-login, I f I add SocialLoginModule.initialize(config) in "imports" in app.module I get always error: ERROR in Error: Metadata version mismatch for module /node_modules/angularx-social-login/angularx-social-login.d.ts, found version 4, expected 3, resolving symbol AppModule in /src/app/app.module.ts, resolving symbol AppModule in /src/app/app.module.ts, resolving symbol AppModule in /src/app/app.module.ts

My version: @angular/cli: 1.4.7 node: 6.11.1 os: win32 x64 @angular/animations: 4.3.2 @angular/cdk: 2.0.0-beta.8 @angular/common: 4.3.2 @angular/compiler: 4.3.2 @angular/core: 4.3.2 @angular/forms: 4.3.2 @angular/http: 4.3.2 @angular/material: 2.0.0-beta.8 @angular/platform-browser: 4.3.2 @angular/platform-browser-dynamic: 4.3.2 @angular/platform-server: 4.3.2 @angular/router: 4.3.2 @angular/cli: 1.4.7 @angular/compiler-cli: 4.3.2 @angular/language-service: 4.3.2 typescript: 2.5.3

Thanks

jaibatrik commented 6 years ago

angularx is the right one. I'll update the README file.

stewartrule commented 6 years ago

I don't think this version works with Angular 4. I'm on Angular 4.4.6 and getting the same error. I'm only using the angularx version.

ERROR in Error: Metadata version mismatch for module /node_modules/angularx-social-login/angularx-social-login.d.ts, found version 4, expected 3
    at StaticSymbolResolver.getModuleMetadata (/node_modules/@angular/compiler/bundles/compiler.umd.js:25616:34)
    at StaticSymbolResolver._createSymbolsOf (/node_modules/@angular/compiler/bundles/compiler.umd.js:25404:46)
    at StaticSymbolResolver.getSymbolsOf (/node_modules/@angular/compiler/bundles/compiler.umd.js:25385:14)
    at /node_modules/@angular/compiler/bundles/compiler.umd.js:24241:30
    at Array.forEach (<anonymous>)
    at extractProgramSymbols (/node_modules/@angular/compiler/bundles/compiler.umd.js:24240:79)
    at AotCompiler.analyzeModulesAsync (/node_modules/@angular/compiler/bundles/compiler.umd.js:23796:47)
    at CodeGenerator.codegen (/node_modules/@angular/compiler-cli/src/codegen.js:32:14)
    at Function.NgTools_InternalApi_NG_2.codeGen (/node_modules/@angular/compiler-cli/src/ngtools_api.js:73:30)
    at _donePromise.Promise.resolve.then (/node_modules/@ngtools/webpack/src/plugin.js:391:44)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7)
    at Function.Module.runMain (module.js:703:11)
    at startup (bootstrap_node.js:194:16)
    at bootstrap_node.js:618:3
  "dependencies": {
    "@angular/animations": "4.4.6",
    "@angular/common": "4.4.6",
    "@angular/compiler": "4.4.6",
    "@angular/compiler-cli": "4.4.6",
    "@angular/core": "4.4.6",
    "@angular/forms": "4.4.6",
    "@angular/platform-browser": "4.4.6",
    "@angular/platform-browser-dynamic": "4.4.6",
    "@angular/router": "4.4.6",
    "angularx-social-login": "1.1.7",
    ...
priyesh-pandya commented 6 years ago

I fixed this issue by this steps

  1. Make sure you delete old version >> npm uninstall angularx-social-login@1.1.7 Or >> npm uninstall angularx-social-login

Note:

  1. Delete the file package-lock.json

  2. Install the exact version >> npm uninstall angularx-social-login@1.1.7

ng serve should work for you