@ngtools/webpack TS Error on build of project

See original GitHub issue

Bug Report or Feature Request (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request

Versions.

Node 8.1.0 NPM 5.0.3 ngtools/webpack 1.7.0-beta.2 Angular 5.0.0-beta.2 Typescript 2.4.2

The log given by the failure.

TS2420: Class ‘VirtualStats’ incorrectly implements interface ‘Stats’. Property ‘atimeMs’ is missing in type ‘VirtualStats’.

Desired functionality.

Compiles correctly

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

14reactions
dogmaticocommented, Aug 28, 2017

Downgrading to @types/node 8.0.19 temporary solved the problem.

2reactions
DanielSchaffercommented, Mar 1, 2018

You can work around this without downgrading @types/node by adding the following to a .d.ts file, and making sure that file is included in your tsconfig.json:

// https://github.com/angular/angular-cli/issues/7474
import { VirtualStats } from '@ngtools/webpack/src/compiler_host';
import * as fs from 'fs';

declare module '@ngtools/webpack/src/compiler_host' {
    interface VirtualStats extends fs.Stats {
        atimeMs: number;
    }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular - Code with Mosh Forum
ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js): Error: Emit attempted before Angular Webpack plugin ...
Read more >
Angular 14, ng serve error - @ngtools/webpack/src/ivy/index.js ...
I got this error, as I stupidly included a package in both declarations and imports in my app.module.ts file:
Read more >
Emit attempted before Angular Webpack plugin initialization ...
ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js): Error: Emit attempted before Angular Webpack plugin initialization. ./ ...
Read more >
New Section - Angular Components and Core Directives
Error: ./src/polyfills.ts. Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js): TypeError: angularCompiler.
Read more >
Error on build --prod - Ionic Angular
Error: ./src/main.ts Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js): TypeError: angularCompiler.
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