sandeep
sandeep

Reputation: 11

The animation trigger "transform" has failed to build due to the

Any one please suggest me while i updated angular/Cli as "@angular/compiler-cli": "5.0.0", i am getting below error.

Failed: The animation trigger "transform" has failed to build due to the - The provided animation property "transform" is not a supported CSS pr - The provided animation property "transform" is not a supported CSS pr

Upvotes: 1

Views: 1540

Answers (1)

Maryna
Maryna

Reputation: 36

I had the same error. I added the following code to server.ts to resolve the issue.

Object.defineProperty(document.body.style, 'transform', {
  value: () => {
    return {
      enumerable: true,
      configurable: true
    };
  },
});

Please see a document, which have to be defined before that:

// https://github.com/angular/universal/issues/830
const domino = require('domino');
const fs = require('fs');
const path = require('path');
const win = domino.createWindow(template);
global['window'] = win;
global['document'] = win.document;

I have taken a solution from here:

https://github.com/angular/material2/issues/7101

Upvotes: 2

Related Questions