heresy / angular2-social-login-example

angular2-social-login Example
13 stars 17 forks source link

ERROR in Error encountered resolving symbol values statically. Calling function 'Angular2SocialLoginModule', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function #1

Closed ArielMorningstar closed 7 years ago

ArielMorningstar commented 7 years ago

Hi, I'm doing a webapp in Angular2 and I'm using your plugin, and I followed the tutorial to make it work, and it does. But everytime my app compiles a error message appears at the terminal:

ERROR in Error encountered resolving symbol values statically. Calling function 'Angular2SocialLoginModule', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function.

I'm using angular-cli, so I don't have system.config.js, and the real problem comes when I run the build --aot command. It throws me the same Error and I cannot make it compile. However it works with the JiT compilator, but it's slow.

How can I fix that Error in my module? Thanks!

sv-dev2 commented 7 years ago

I do have a problem calling the method with provider in .Net core.Anyone found the solution please suggest

logavdm commented 7 years ago

Hi. I also Getting This errors to i am using angular cli version 1.0.0-rc.0 angular compiler-cli 2.4.8

ERROR in Error encountered resolving symbol values statically. Calling function 'Angular2SocialLoginModule', function calls are not supported. Consider replacin g the function or lambda with a reference to an exported function, resolving sym bol AppModule in D:/Angularjs2/Login Google/src/app/app.module.ts, resolving sym bol AppModule in D:/Angularjs2/Login Google/src/app/app.module.ts

techtic-chetan commented 7 years ago

Hello,

I am getting same error, Please help me.

image

kurapatijayaram commented 7 years ago

Hi everyone, we didn't faced this error in our applications because we are not using angular-cli. Many people who are using angular-cli are facing this issue, you can check this link https://github.com/angular/angular-cli/issues/3707 . I will try to solve this issue as early as possible. If you found the solution let me know.

Thank you.

logavdm commented 7 years ago

In that same project i also used the RouterModule.forRoot(appRoutes); that's works fine but the Angular2SocialLoginModule.initWithProviders(providers) this lines only show me error...

My package.json

{
  "name": "my-app",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "^2.4.0",
    "@angular/compiler": "^2.4.0",
    "@angular/core": "^2.4.0",
    "@angular/forms": "^2.4.0",
    "@angular/http": "^2.4.0",
    "@angular/platform-browser": "^2.4.0",
    "@angular/platform-browser-dynamic": "^2.4.0",
    "@angular/router": "^3.4.0",
    "angular2-modal": "^2.0.3",
    "angular2-social-login": "^2.0.2",
    "core-js": "^2.4.1",
    "ng2-bs3-modal": "^0.10.4",
    "rxjs": "^5.1.0",
    "zone.js": "^0.7.6"
  },
  "devDependencies": {
    "@angular/cli": "1.0.0-rc.0",
    "@angular/compiler-cli": "^2.4.0",
    "@types/jasmine": "2.5.38",
    "@types/node": "~6.0.60",
    "codelyzer": "~2.0.0",
    "jasmine-core": "~2.5.2",
    "jasmine-spec-reporter": "~3.2.0",
    "karma": "~1.4.1",
    "karma-chrome-launcher": "~2.0.0",
    "karma-cli": "~1.0.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "karma-coverage-istanbul-reporter": "^0.2.0",
    "protractor": "~5.1.0",
    "ts-node": "~2.0.0",
    "tslint": "~4.4.2",
    "typescript": "~2.0.0"
  }
}

My config.json

{
  "compilerOptions": {
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [
      "es2016"
    ],
    "outDir": "../out-tsc/spec",
    "module": "commonjs",
    "target": "es6",
    "baseUrl": "",
    "types": [
      "jasmine",
      "node"
    ]
  },
  "files": [
    "test.ts"
  ],
  "include": [
    "**/*.spec.ts"
  ]
}
kpsrinivas commented 7 years ago

Can you add this line and check.

ng build --aot false

logavdm commented 7 years ago

No Luck Got Same error kpsrinivas image

phongyu commented 7 years ago

Does anyone has solution for it? I have got this issue for long, my app cannot go live because of this problem

vijayvyas commented 7 years ago

this code not working please upgrade the versions.

kurapatijayaram commented 7 years ago

@vijayvyas this code is working perfectly with JIT compiler. If you faced any issue ? please mention that. This issue with angular-cli and AOT.

atom-morgan commented 7 years ago

One weird quirk I'd like to add is that I'll get the same error message the first time I run ng serve but if I save a file to trigger webpack to recompile again, it works. Running ng test always shows this error.

kpsrinivas commented 7 years ago

When you have "module": "corejs" its giving that bug. "module": "es2015" is working

atom-morgan commented 7 years ago

@kpsrinivas Are you able to run ng build and ng test successfully?

I'm actively working on finding a solution to this.

susheelbanyal commented 7 years ago

Hi there, has anyone solve this problem? I have the same problem. ERROR in Error encountered resolving symbol values statically. Calling function 'Angular2SocialLoginModule', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol XyzModule in /var/www/html/frontendapp/src/app/xyz/xyz.module.ts, resolving symbol XyzModule in /var/www/html/frontendapp/src/app/xyz/xyz.module.ts I am using AngularCLI with webpack. Please Help me solving this issue. Thanks in advance.

sulthan-ti commented 7 years ago

I Uninstalled angular-cli, but still the problem exists

alexzuza commented 7 years ago

Hi! Can you try this answer? http://stackoverflow.com/questions/43580314/calling-angular2socialloginmodule-function-calls-not-supported/43581600#43581600

susheelbanyal commented 7 years ago

Yes It worked for me. Thanks @alexzuza

sulthan-ti commented 7 years ago

@kurapatijayaram , please go through this link. yurzui give a solution for this problem

http://stackoverflow.com/questions/43580314/calling-angular2socialloginmodule-function-calls-not-supported/43581600#43581600

kurapatijayaram commented 7 years ago

@sulthan-ti I am aware of that solution, Sometimes it may cause you some issues with that. Give me two days time we solved this issue and also got one nice fix from one user. We will let you know when it got pushed.

Thank you.

atom-morgan commented 7 years ago

@susheelbanyal The issue with that solution is the AuthService is no longer a singleton. See Why UserService isn't shared.

alexzuza commented 7 years ago

@atom-morgan I provided AuthService within AppModule. why is not it singleton?

atom-morgan commented 7 years ago

@alexzuza I provided a link above.

Edit: I should clarify that it only applies with a lazy loaded module.

alexzuza commented 7 years ago

@atom-morgan I read this article many times. What is wrong with this solution? I didn't provide it within component injector or shared module

kurapatijayaram commented 7 years ago

@atom-morgan even the solution specified by @alexzuza will maintain AuthService as a singleton.

kurapatijayaram commented 7 years ago

Issue fixed. Use v3.0.0 https://github.com/heresy/angular2-social-login/tree/v3.0.0