-
Notifications
You must be signed in to change notification settings - Fork 12k
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
ERROR in Error encountered resolving symbol values statically. Calling function 'PerfectScrollbarModule', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function #3707
Comments
Also getting this error, upgrading typescript seems to resolve it (although it might create other errors :/) |
|
angular2-perfect-scrollbar is just one example , the are plenty modules like that. What you saying all of them will not be compatible with Angular CLI? What that means to us? We can not upgrade because of 3rd party modules simply will stop working. That is kind of odd path. Where would I find information about "publishing metadata" in context with CLI compatibility? |
We are working in the future to show a warning for those. I also think it shouldn't be an error, but there are cases where an error can happen because of these libraries (routing for example) and these libraries are not AOT-compatible (at all!). We have clear guidelines for libraries that include generating those files and what to publish to NPM. If libraries don't follow those guidelines we can't guarantee that they'll be compatible. And yes, we have report of these a lot, and when I tell the relation team they are actually efficient in dealing with those. So there's hope. |
please provide a link to your clear guidelines about publishing compatible library, I'm trying to make one and I'd like it to be compatible. |
@hansl I'm having the same problem with Angular-Datatables. is there anything we can do ourselves? or should we always wait for the 3rd party libraries to publish metadata. |
I have same issue. in beta.22 all work fine. but when I upgrade to beta.24 I got the following error: |
I have the same issue with:
Error:
|
@Bretto That seems to be a missing export error. |
I solved it by replace the anonymous (lambda) method to explicitly method: instead of: |
@baruchvlz the application works, I don't think its a missing export
With the same code other project on previous version of the CLI had no issues... Currently the application works but when it starts with a big error like this it doesn't look good/pro...
but the problem remains. |
@loicsalou I just came across your comment. You can refer to this guide https://medium.com/@cyrilletuzi/how-to-build-and-publish-an-angular-module-7ad19c0b4464#.9y88ipdk7 on how to make a working module. |
I start using ng2-cli but why official Angular 2 core library will trigger this error? Very frustrated for switching to AoT after over 1 day of trying.... |
I had the same issue @tom10271. I think your problem is different than op's. Please check if you have a node_modules folder in ./src folder and if so remove it. |
@Bretto I have the same problem. In localhost, it's working even if there is the error. But with Jenkins, the build crash. |
My Custom Module and the App had different versions of Ng2. After I updated both to the last version of angular the issue disappeared in my case. Hope this helps... |
The error even shows up when your using "window." or "location." in your environment file :s |
I am getting the same error, i tried to fix it by converting into an export function: {provide: APP_INITIALIZER, useFactory: textFunction, deps: [AppConfig], multi: true }, Error: AppInits[i] is not a function Step2: Error: AppInits[i] is not a function When i convert into an export function compiler error gets disappeared but the app breaks with appInits[i] is not a function. Can you please guide me how to convert appIntializer useFactory to an export method. |
I get the same error with angular2-cool-storage
|
Related AOT build issue here:
I have seen reports on issues with AOT and |
…pression by webpack. see angular/angular-cli#3707 (comment)
Fixed by deleting |
ERROR in Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function (position 69:19 in the original .ts file), resolving symbol AppModule in app.module.ts |
Can any one help me to fix this problem in my code??? ERROR in Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function (position 69:19 in the original .ts file), resolving symbol AppModule in src/app/app.module.ts |
@Abrhaley1 you should provide at least some of the corresponding code so we can suggest you modifications. Also I'm sure if you check some of the previous suggestions and solutions in this thread you will find some guidelines and solutions that might solve your problem. |
it woooooooooorks ^^ just I add "paths": { "@angular/": ["../node_modules/@angular/"] } in tsconfig |
What I did to fix this issue was not using lambda in the function I was passing as parameter for |
This issue should be locked for any further discussion because we figure it out, that the issue is current limitations of AOT and that we should follow the guidelines in order to make code AOT compatible. There is bunch of good articles/solutions mentioned in this thread so listing the known solutions on and on is not productive and does not help anyone. cc: @Oleg1969 |
@metodribic Why do I have this problem when using |
Sorry I ment Angular CLI instead of AOT. But actually all of this problems are related to AOT somehow, since AOT compatible code resolves the issue... |
Got the same issue by using 'angular2-notifications' issue. |
Had an issue with declaring a variable inside of a custom Turned that variable into an exported const, and it solved the issue... for some reason, it doesn't like variable declared inside of the It also happens with |
Issue with providing with lambda: angular/angular-cli#3707
Issue with providing with lambda: angular/angular-cli#3707
I tried to define routes like the following and came across this error. export const routes: Routes = ['open', 'closed', 'processing', 'done']
.map(status => ({ path: `${status}/list`, component: ListComponent, data: { status } })); The following code also raised the same error.
I also tried the following code, which results in a different error: export function createRoute(status: string) {
return { path: `${status}/list`, component: ListComponent, data: { status } };
}
export const routes: Routes = ['open', 'closed', 'processing', 'done'].map(createRoute); I ended up using the following code, which works but is disappointing... export const routes: Routes = [
{ path: 'open/list', component: ListComponent, data: { status: 'open' } },
{ path: 'closed/list', component: ListComponent, data: { status: 'closed' } },
{ path: 'processing/list', component: ListComponent, data: { status: 'processing' } },
{ path: 'done/list', component: ListComponent, data: { status: 'done' }},
]; |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
OS?
Versions.
Repro steps.
The log given by the failure.
ERROR in Error encountered resolving symbol values statically. Calling function 'PerfectScrollbarModule', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in /.../app.module.ts, resolving symbol AppModule in /..../src/app/app.module.ts
Mention any other details that might be useful.
angular version 2.3.1
The text was updated successfully, but these errors were encountered: