Getting Error encountered resolving symbol values statically. Calling function 'makeDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol Injectable
OS?
MacOS Sierre
Versions.
angular-cli: 1.0.0-beta.19-3 node: 6.2.2 os: darwin x64
Repro steps.
Getting this error with using Angular CLI
Error encountered resolving symbol values statically. Calling function 'makeDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol Injectable in /Users/mbp06/Repos/multiple-date-picker-a2/node_modules/@angular/core/src/di/metadata.d.ts, resolving symbol OpaqueToken in /Users/mbp06/Repos/multiple-date-picker-a2/node_modules/@angular/core/src/di/opaque_token.d.ts, resolving symbol OpaqueToken in /Users/mbp06/Repos/multiple-date-picker-a2/node_modules/@angular/core/src/di/opaque_token.d.ts
@gnesher I do not hope so. We have enough challenges in our code, we don't need challenges in foreign code also :-) So what can we do? I need to compile the code to get in running on our server.
@n4uoase you can try to reach out to the developers through gitter, they are usually responsive and will try to help - though frankly that fact that they've not updated the docs to reflect these problems after 7 months means this can't be a mistake. Personally I've decided to switch frameworks on all new projects. I'm only here trying to maintain a single legacy application. It's funny how an Angular2 application became legacy after 6 months of use...
I got the same error upgrading from angular 2.4 to angular 4.0.
The library I was relying on had angular 2.4 as a dependency in their package.json. Changing that to a more relaxed peerDependency >2.4 or devDependency >2.4, fixed the issue for me.
Simon could you explain in detail what you did? I am getting the same error. it would be a great help.
In the failing library's package.json I changed:
"dependencies": {
"@angular/common": "^2.3.1",
etc....
}
to
"peerDependencies": {
"@angular/common": ">=2.3.1",
etc....
}
Fix it with thanks to the post of @Simon-Briggs. Of course this implies to be able to update the module causing the problem.
Are these third party modules you are referring to? Could you give an example of one? My app doesn't use any non-official Angular modules, so I can't imagine this solves it for me.
Hi, I think this bug is teasing us one by one.
- I am running angular 4; (after experiencing the problem updated all my node modules dependencies to latest see at the end the versions I am using)
- my editor is VS code;
- all is running fine this morning (and I might add I was seeing for the first time my app running as intended end to end). Then I was prompted to update VSC which I did.
- And started getting the error
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 24:10 in the original .ts file), resolving symbol Model_Instance_Generator .....
I am injecting the model factory using an exported def from model_factory.ts file. If I remove the provider injected at module level it builds but this is not a solution for me. I spent the last 4 hours struggling to solve this with no avail ... Please if someone knows why we started experiencing this I appreciate the help ...
/ \ _ __ __ _ _ | | __ _ _ __ / | | | |
/ △ \ | ' \ / _ | | | | |/ _ | '| | | | | | |
/ ___ | | | | (| | || | | (| | | | || | | |
// __| ||_, |_,||_,|| _|||
|___/
@angular/cli: 1.0.0 (e)
node: 7.7.4
os: win32 x64
@angular/animations: 4.0.1
@angular/common: 4.0.1
@angular/compiler: 4.0.1
@angular/compiler-cli: 4.0.1
@angular/core: 4.0.1
@angular/forms: 4.0.1
@angular/http: 4.0.1
@angular/platform-browser: 4.0.1
@angular/platform-browser-dynamic: 4.0.1
@angular/platform-server: 4.0.1
@angular/router: 4.0.1
@angular/cli: 1.0.0
Can u provide the entire error message? On Thu, Apr 6, 2017 at 10:40 AM bammadamma [email protected] wrote:
Hi, I think this bug is teasing us one by one.
I am running angular 4; (after experiencing the problem updated all my node modules dependencies to latest see at the end the versions I am using)
my editor is VS code;
all is running fine this morning (and I might ass I was seeing for the first time my app running as intended end to end). Then I was prompted to update VSC which I did.
And started getting the error
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 24:10 in the original .ts file), resolving symbol Model_Instance_Generator .....
I am injecting the model factory using an exported def from model_factory.ts file.
If I remove the provider injected at module level it builds but this is not a solution for me.
I spent the last 4 hours struggling to solve this with no avail ...
Please if someone knows why we started experiencing this I appreciate the help ...
/ \ _ __ __ _ _
| | __ _ _ __ / | | | |/ △ \ | ' \ / _| | | | |/ _ | '| | | | | | |/ ___ | | | | (| | || | | (| | | | |
| |___ | |// __| ||_, |,|*|,|| _|**|*_|
|___/
@angular/cli: 1.0.0 (e)
node: 7.7.4
os: win32 x64
@angular/animations: 4.0.1
@angular/common: 4.0.1
@angular/compiler: 4.0.1
@angular/compiler-cli: 4.0.1
@angular/core: 4.0.1
@angular/forms: 4.0.1
@angular/http: 4.0.1
@angular/platform-browser: 4.0.1
@angular/platform-browser-dynamic: 4.0.1
@angular/platform-server: 4.0.1
@angular/router: 4.0.1
@angular/cli: 1.0.0
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/angular/angular-cli/issues/4647#issuecomment-292195484, or mute the thread https://github.com/notifications/unsubscribe-auth/AH3Thcb1bkrow3TIAVv0y87HOVk7iOamks5rtPlkgaJpZM4L-xjH .
@chinenyem thank you below is the full error message ...
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 24:10 in the original .ts file), resolving symbol Model_Instance_Generator in D:/projectfinmal/finmal_poc/fml-new/fmlpoc/src/services/wp/model_factory.ts, resolving symbol Model_Instance_GeneratorDef in D:/projectfinmal/finmal_poc/fml-new/fmlpoc/src/services/wp/model_factory.ts, resolving symbol Model_Instance_GeneratorDef in D:/projectfinmal/finmal_poc/fml-new/fmlpoc/src/services/wp_service.ts, resolving symbol AppModule in D:/projectfinmal/finmal_poc/fml-new/fmlpoc/src/app/app-module.ts, resolving symbol AppModule in D:/projectfinmal/finmal_poc/fml-new/fmlpoc/src/app/app-module.ts
Thanks now can u provide the code for model_factory.ts.
Hi, @chinenyem ( Thank you for your help will update when I know further about the error or if it recurs again)
removed node_module and reinstalled again afresh; tried to npm run build. It failed with the same error message; then removed the factory provider, it built but can not run it as it is buggy because of the removed instance generator; finally put back the provider and this time started it using npm start ( I am using custom webpack after ejecting hence the npm start rather than ng server)
to my surprise, it worked no more the error. I am very puzzled, when I know why it worked I will post but for the time being with all my confusion I will keep on developing and keep an eye on it.
Same error happening here after upgrading Ionic 2 to Ionic 3. Why has been this issue closed?
Any solution so far?!
@Simon-Briggs that worked for me dude! Thank you!!! 🌚
Using ng build --prod --aot=false you wont face this problems hopefully and I also went throw all of the errors and fixed them which took me about a day and in the end the results are as follow:
ng build --prod 4.20MB(without assets)
ng build --prod --aot=false 4.19MB(without assets)
Angular: 4.0.2 CLI: 1.0.0
Hope u find it useful.
@sabrio This will use the JiT compiler, which will give a bigger and slower app - something AoT is designed to avoid.
@larssn It may decrease the performance (I am not sure about this) but in term of size it is almost the same, I have at least 20 component and huge app and the result are the same.
@sabrio Well when using JiT, the templates are compiled dynamically at runtime, by the client. AoT compiles them at compile-time.
And if you use AoT you should be able to remove the dependency on "@angular/platform-browser-dynamic", which in turn should make your build smaller.