Updated to angular/cli:^1.6.8 - Error during template compile of 'PlatformRef'
See original GitHub issueVersions
<!--
Output from: `ng --version`.
If nothing, output from: `node --version` and `npm --version`.
Windows (7/8/10). Linux (incl. distribution). macOS (El Capitan? Sierra?)
-->
Angular CLI: 1.6.8 (e) Node: 8.9.1 OS: darwin x64 Angular: 5.2.4 … animations, common, compiler, compiler-cli, core, forms … http, language-service, platform-browser … platform-browser-dynamic, router
@angular/cdk: 5.2.0
@angular/cli: 1.6.8
@angular/material: 5.2.0
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.8
@schematics/angular: 0.1.17
typescript-extends: 1.0.1
typescript: 2.4.2
webpack-concat-plugin: 1.4.0
webpack-dev-server: 2.11.1
webpack: 3.10.0
Repro steps
- Step 1
- Step 2
- Step 3
Observed behavior
<!-- Normally this includes a stack trace and some more information. -->
ERROR in Error during template compile of 'PlatformRef'
Function calls are not supported in decorators but 'ɵmakeDecorator' was called in 'Injectable'
'Injectable' calls 'ɵmakeDecorator'.
Desired behavior
Mention any other details that might be useful (optional)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:18 (1 by maintainers)
Top Results From Across the Web
Error during template compile of 'ea' - angular - Stack Overflow
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...
Read more >Error during template compile of 'HomeModule' Function calls ...
I got the error : ERROR is Error during template compile of 'HomeModule' Function calls are not supported in decorators but 'ChartModule' ...
Read more >Angular 9's Best Hidden Feature: Strict Template Checking
We could fix this error now, but let's see what happens when we compile with Angular 9. Angular 9's No Strict Templates. After...
Read more >Building Angular 6 library fails, with a vague error.
@angular\core\core.ts(194,50): Error during template compile of 'NgModule' ... -packagr\lib\ngc\compile-source-files.js:7:71 at new Promise (<anonymous>) at ...
Read more >ERROR in Error during template compile of 'AppModule'
Coding example for the question ERROR in Error during template compile of ... new InjectionToken<ActionReducerMap<ICommonAppState>>('App Reducers'); ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I managed to figure out what was causing this error in my case. (Seems like this could be caused by many things.)
I have an application that uses a library, where I develop both of them, and the library is symlinked to the application. The library would
import { ... } from '@angular/core'
, but was trying to pull@angular/core
from thenode_modules
local to that library instead of thenode_modules
local to the application.Adding the Angular modules to the
paths
intsconfig.app.json
solved the issue. It’ll point all of the Angular imports to thenode_modules
in the application instead of thenode_modules
in the library.This error is occurring to me with
^6.0.0
versions.