4
votes

I have a issue when compile my angular

ERROR in Error during template compile of 'ɵa' Function calls are not supported in decorators but 'ɵmakeDecorator' was called in 'Injectable' 'Injectable' calls 'ɵmakeDecorator'.

How could I fix this error?

3
Show some code?pixelbits
Any luck with this? I'm seeing pretty much an identical error after upgrading from Angular 4.x to 5.2.2 and angular-cli "^1.2.6" (not sure exactly what I had installed that was working before...) to 1.6.4 (1.6.6 hasn't fixed the error). Did a full case-insensitive search for "emakedecorator" in my project, including /node_modules, with 0 hits, so presumably this is something generated by the build process.Sean
me too facing same issue and below answers doesnt work for me. Currently I am using 5.2.0. I tried on angular core version 4.4.3 but no luckMorez

3 Answers

5
votes

So, I had this exact same issue when attempting to update Angular from 4.x to 5.x.

The problem has something to-do with the AOT compilation, but dont ask me any further on this. I cant explain anything in detail.

However, go to your tsconfig.app.json and add the following line:

"paths": { "@angular/*": ["../node_modules/@angular/*"] },

Also make sure that in the same file, the module is set to 'es2015'.

Hope this works for you!

1
votes

I would check any 3rd party tools you're using to make sure they don't have dev-dependencies on an older version of Angular.

I was seeing this same error when I updated Angular from 4.x to 5.x, and I later noticed that one of my 3rd party libraries was actually installing its own version of Angular 4.x as a dev-dependency.

Unfortunately in my case this library didn't have a newer version that supported Angular 5.x, so I had to switch it out.

0
votes

This error occurs if you're importing a file outside your Angular project. In my case, I accidentally imported a TypeScript file with the same name from a different project. So search for suspicious imports like ../...