Build --prod enoent error

Hello everyone when i try to ionic cordova build android --prod it gives I saw lots of similar issue but didn’t help

Error: ./~/ng2-search-filter/src/ng2-filter.pipe.ts
Module build failed: Error: ENOENT: no such file or directory, open 'C:\Users\eg\Desktop\myApp\app\node_modules\ng2-search-filter\src\ng2-filter.pipe.js.map'
 @ ./src/pages/home/home.ngfactory.ts 43:0-66
 @ ./src/app/app.module.ngfactory.ts
 @ ./src/app/main.ts,./~/ng2-search-filter/src/ng2-filter.module.ts
Module build failed: Error: ENOENT: no such file or directory, open 'C:\Users\eg\Desktop\myApp\app\node_modules\ng2-search-filter\src\ng2-filter.module.js.map'
 @ ./src/app/app.module.ngfactory.ts 23:0-68
 @ ./src/app/main.ts

here is my ionic info


    @ionic/cli-utils  : 1.8.1
    ionic (Ionic CLI) : 3.8.1

global packages:

    Cordova CLI : 6.5.0

local packages:

    @ionic/app-scripts : 1.3.7
    Cordova Platforms  : android 6.1.2
    Ionic Framework    : ionic-angular 3.1.1

System:

    Node : v7.9.0
    npm  : 4.1.2
    OS   : Windows 10

Thank you

Upgrade this to a recent version. (Note the breaking changes at 2.x in the changelog)

I did it but now it gives an error Error: Uglify failed: Unexpected token: name (MapModal) in undefined at line undefined, col undefined, pos undefined

Then fix that. Seems oyu have something where it shouldn’t be. Does it build without --prod still?

I can build without prod even i can ionixlc cordova run android but prod doesnt work

It is clearly mentioned .map file is not found.

The .map file is exist here
C:\Users\eg\Desktop\myApp\app\node_modules\ng2-search-filter\dist\src folder so copy that files and paste
C:\Users\eg\Desktop\myApp\app\node_modules\ng2-search-filter\src\ folder.

Please let me know if it not works.

Do not follow the above advice. npm owns the node_modules directory, and you should not manually modify things under it.

1 Like

then you need to create issue on their github repo. @rapropos My solution was quick fix.

Hi any Solution you found for this

I solved the problem by removing the following lines in package.json file

  "config": {
    "ionic_source_map_type": "inline-source-map"
  }