Getting this error today when building my app

I am about to completely go crazy. My dear project is no longer working, today when i try to run on my android device, i get the following:

[21:01:05]  transpile started ...
[21:01:11]  typescript: .../feederhorgasz/node_modules/@ionic/app-scripts/dist/util/virtual-file-utils.d.ts, line: 3
            Class 'VirtualStats' incorrectly implements interface 'Stats'. Property 'atimeMs' is missing in type

       L2:  export declare class VirtualStats implements Stats {
       L3:      protected _path: string;
       L4:      protected _ctime: Date;

Error: Failed to transpile program
    at BuildError.Error (native)
    at new BuildError (C:\Users\Thomas\mobiledevelopment\feederhorgasz\node_modules\@ionic\app-scripts\dist\util\errors.js:16:28)
    at C:\Users\Thomas\mobiledevelopment\feederhorgasz\node_modules\@ionic\app-scripts\dist\transpile.js:159:20
    at transpileWorker (C:\Users\Thomas\mobiledevelopment\feederhorgasz\node_modules\@ionic\app-scripts\dist\transpile.js:107:12)
    at Object.transpile (C:\Users\Thomas\mobiledevelopment\feederhorgasz\node_modules\@ionic\app-scripts\dist\transpile.js:64:12)
    at C:\Users\Thomas\mobiledevelopment\feederhorgasz\node_modules\@ionic\app-scripts\dist\build.js:106:82

What is your ionic info output?
What command are you using to build?

i am using the usual command: ionic cordova run android

ionic info:
cli packages: (C:\Users\Thomas\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.12.0
ionic (Ionic CLI) : 3.12.0

global packages:

cordova (Cordova CLI) : 7.0.1

local packages:

@ionic/app-scripts : 3.0.0
Cordova Platforms  : android 6.2.3
Ionic Framework    : ionic-angular 3.7.1


Node : v6.11.3
npm  : 3.10.10
OS   : Windows 10


backend : pro

That looks all good.

Create a new project with ionic start and try building that one.

it is working with other projects. How could i fix my own? :frowning:

Try running npm run ionic:build --verbose and see if this gives you additional output.
Otherwise: Copy the files over to the newly created project and see when it starts failing.

This looks like a TypeScript error, and according to the stack trace it appears that VirtualStats is missing a property named atimeMs as specified by the Stats interface.

1 Like

Put this code on Your project folder\node_modules@ionic\app-scripts\dist\util\virtual-file-utils.d.ts

readonly atimeMs: any;
readonly mtimeMs: any;
readonly ctimeMs: any;
readonly birthtimeMs: any;