-
Notifications
You must be signed in to change notification settings - Fork 12k
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 #4647
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
Comments
same here.
become this:
but it didn't happen before. |
also re-opened at #3707 |
I'm getting this error on
I'm using Angular v2.4.7 and Angular CLI v1.0.0-beta.31. |
I also found some strange things: #3674 (comment) |
Getting the exact same issue with a brand new application I just made now. When I do
I get this:
Here's my package.json
|
I got the following message: but application works fine, |
This error can also be thrown by referencing modules outside of your project directory. If you have a shared folder that you keep re-usable modules and are referencing modules in that directory through relative references you will get this error, also. Using a symbolic link to the shared directory fixed this issue for me. |
Heya, errors like The CLI always runs statical analysis on code to ensure it will run when compiled with AOT. This may cause a lot of static analysis errors to surface when importing your project into the CLI, or upgrading for older versions where we didn't run this kind of analysis. A good resource on how to to debug these errors is https://github.com/rangle/angular-2-aot-sandbox#aot-dos-and-donts. |
Why am I being blindsided? When I run the build with the --dev flag, everything works. Running it with the --prod flag breaks the build. WHY?!?!?! I'm getting really tired of error messages that don't help. If it is in @angular, it shouldn't be my concern. Tell me what in my code is now magically breaking when it was working fine in non-production mode. 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 .../node_modules/@angular/core/src/di/metadata.d.ts, resolving symbol OpaqueToken in .../node_modules/@angular/core/src/di/opaque_token.d.ts, resolving symbol OpaqueToken in .../node_modules/@angular/core/src/di/opaque_token.d.ts |
I find it very "Opaque" |
I believe this to be a bug as well. I get the warning, but once I save a source file the error disappears and the build completes successfully. |
I was getting this error just now, but it turned out that the syntax error was in my HTML file. I had a messed up HEAD tag without a proper closing tag. Once I fixed that, the compile happened fine. So look out for errors in HTML too. |
@snaikaw same happened to me but when I run ng serve again, the error returned but after some onChange recompilation disappeared with success. |
@filipesilva What older versions are you referring to here? I'm trying to upgrade from 2.3 to 4.0 and am getting below. Since it doesn't reference any of my own code I have no idea what is causing it. Have the AOT rules changed between 2.3 and 4.0 at all? Thanks
|
@1-0-1 ng build -prod now enables aot by default if I'm not mistaken. You can still use ng build -prod -aot=false. |
@filipesilva don't you think that after 6-7 months of the initial release it's time to have an official document on how to get AOT working? I love the work the Rangle.io guys have done and it's super helpful, but it's not complete and still leaves quite a bit of guesswork... |
Why is this issue closed? Seems that lot of people running in the very same error. Anybody able to help with this? |
@n4uoase I do believe the Angular team does not consider this a "problem" more like a community challenge... |
+1 getting the same error when trying to update from 2.4 to 4.0. |
Same with me ... upgarded angular-cli from beta to release ... and problem appearing in one of the angular module ... |
@gnesher I do not hope so. We have enough challenges in our code, we don't need challenges in foreign code also :-) |
@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:
to
|
facing below issue when importing function from module as 'RiaCommonsModule.forRoot()' ERROR in Error encountered resolving symbol values statically. Calling function 'RiaCommonsModule', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol getRiaCommonsModule in D:/SureCall/Angular-CLI/AnC-Client/src/app/app.module.lib.ts, resolving symbol AppModuleLib in D:/SureCall/Angular-CLI/AnC-Client/src/app/app.module.lib.ts, resolving symbol AppModuleLib in D:/SureCall/Angular-CLI/AnC-Client/src/app/app.module.lib.ts |
@trekhleb 's solution did not work for me, unfortunately. I have the exact same error as him, and I don't have any yarn-linked projects (although I have one external project being referenced in a lot of components, but I reference it directly, not via yarn link). I have specified paths in the tsconfig.json file but I still receive the same error:
|
@trekhleb for me it is working too ... thank you. |
Adding |
I followed @Simon-Briggs April 4 suggestion, and in addition removed the dependency's node_modules folder. Working fine now. |
@trekhleb 's solution didnt work for me too. I added path in tsconfig.json file but still receive the same error |
I've got ng2-translate modul TranslateStaticLoader problem like @webernir. his solution can't fixed my problem, but after I add "export" keyword to his httpFactory function error fixed, like this: |
Thank you for your reply, hey the problem was solved,
I add you on Github k?
2017-08-04 20:19 GMT+07:00 Sukaina Rizvi <[email protected]>:
… Try: npm install --save @angular/cdk
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4647 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AbyrUB_38zBLXyg5rI0U8uOroZJGb6W3ks5sUxpPgaJpZM4L-xjH>
.
|
I made this mistake when I created a new project, but tried all the solutions failed, what should I do? |
Plus one |
@trekhleb for me it is working too :D |
Just FYI there's now official troubleshooting guide for this error https://angular.io/guide/metadata#function-calls-are-not-supported. None of the things listed there helped me. It turned out the problem was that the library I'm developing didn't specify |
@trekhleb your solution does not work for me. I am getting following error message when trying to import angular-seed-library into a ionic project. 1: I have tried "paths": { "@angular/": ["../node_modules/@angular/"] } in both tsconfig of angular-seed-library and also in ionic project no solution still the same error. LoginComponent is a component that I have made in angular-library-seed at the moment its very simple and basic component.
|
wow, I wonder if React developers are dealing with issues like this? |
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?
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
The text was updated successfully, but these errors were encountered: