question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Updated to angular/cli:^1.6.8 - Error during template compile of 'PlatformRef'

See original GitHub issue

Versions

<!--
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:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:18 (1 by maintainers)

github_iconTop GitHub Comments

17reactions
mderochecommented, Apr 11, 2018

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 the node_modules local to that library instead of the node_modules local to the application.

Adding the Angular modules to the paths in tsconfig.app.json solved the issue. It’ll point all of the Angular imports to the node_modules in the application instead of the node_modules in the library.

  "compilerOptions": {
    "paths": {
        "@angular/*": [ "../node_modules/@angular/*"]
    }
  }
2reactions
rtmcommented, Jun 4, 2018

This error is occurring to me with ^6.0.0 versions.

ERROR in …/@nims/ngutils/lib/collapsible-fieldset/collapsible-fieldset.component.ts(13,2): Error during template compile of ‘CollapsibleFieldsetComponent’ Function calls are not supported in decorators but ‘ɵmakeDecorator’ was called in ‘Component’ ‘Component’ calls ‘ɵmakeDecorator’.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found