diff --git a/packages/elements/src/create-custom-element.ts b/packages/elements/src/create-custom-element.ts index 53b55890fe..d4c429cab6 100644 --- a/packages/elements/src/create-custom-element.ts +++ b/packages/elements/src/create-custom-element.ts @@ -213,7 +213,11 @@ export function createCustomElement

( // compliance with the spec). This breaks emulated inheritance in ES5 on environments that do not // natively support `Object.setPrototypeOf()` (such as IE 9-10). // Update the property descriptor of `NgElementImpl#ngElementStrategy` to make it enumerable. - Object.defineProperty(NgElementImpl.prototype, 'ngElementStrategy', {enumerable: true}); + // The below 'const', shouldn't be needed but currently this breaks build-optimizer + // Build-optimizer currently uses TypeScript 3.6 which is unable to resolve an 'accessor' + // in 'getTypeOfVariableOrParameterOrPropertyWorker'. + const getterName = 'ngElementStrategy'; + Object.defineProperty(NgElementImpl.prototype, getterName, {enumerable: true}); // Add getters and setters to the prototype for each property input. defineInputGettersSetters(inputs, NgElementImpl.prototype);