diff --git a/packages/angular_devkit/schematics/src/rules/template.ts b/packages/angular_devkit/schematics/src/rules/template.ts index 31327035e094..c2105477dcfa 100644 --- a/packages/angular_devkit/schematics/src/rules/template.ts +++ b/packages/angular_devkit/schematics/src/rules/template.ts @@ -62,7 +62,7 @@ export function applyContentTemplate(options: T): FileOperator { content: Buffer.from(templateImpl(decodedContent, {})(options)), }; } catch (e) { - if ((e as NodeJS.ErrnoException).code === 'ERR_ENCODING_INVALID_ENCODED_DATA') { + if (e instanceof TypeError) { return entry; }