Ionic-framework: ionic 4 build --prod issue

Created on 24 Jan 2018  路  3Comments  路  Source: ionic-team/ionic-framework

Ionic version:
[ ] 2.x
[ X] 3.x 3.9.2
[] 4.x

I'm submitting a ...
[ X] bug report
[ ] feature request

Current behavior:

ionic cordova build andorid and ionic serve work fine without any error
when i try to build it with --prod falg by using ionic cordova build andord --pord
i get this error

Error: Entry module not found: Error: Can't resolve '@angular-devkit/build-optimizer/webpack-loader' in '__Projecy.Directory__\__Sub.Projecy.Directory__\__prodect.name__\__prodect.name__'
resolve '@angular-devkit/build-optimizer/webpack-loader' in '__Projecy.Directory__\__Sub.Projecy.Directory__\__prodect.name__\__prodect.name__'
  Parsed request is a module
  using description file: __Projecy.Directory__\__Sub.Projecy.Directory__\__prodect.name__\__prodect.name__\package.json (relative path: .)
  after using description file: __Projecy.Directory__\__Sub.Projecy.Directory__\__prodect.name__\__prodect.name__\package.json (relative path: .)
    resolve as module
      __Projecy.Directory__\__Sub.Projecy.Directory__\__prodect.name__\node_modules doesn't exist or is not a directory
      __Projecy.Directory__\Documents\node_modules doesn't exist or is not a directory
      __Projecy.Directory__\node_modules doesn't exist or is not a directory
      C:\Users\node_modules doesn't exist or is not a directory
      C:\node_modules doesn't exist or is not a directory
      looking for modules in __Projecy.Directory__\__Sub.Projecy.Directory__\__prodect.name__\__prodect.name__\node_modules
        using description file: __Projecy.Directory__\__Sub.Projecy.Directory__\__prodect.name__\__prodect.name__\package.json (relative path: ./node_modules)
        after using description file: __Projecy.Directory__\__Sub.Projecy.Directory__\__prodect.name__\__prodect.name__\package.json (relative path: ./node_modules)
          using description file: __Projecy.Directory__\__Sub.Projecy.Directory__\__prodect.name__\__prodect.name__\package.json (relative path: ./node_modules/@angular-devkit/build-optimizer/webpack-loader)
            no extension
              __Projecy.Directory__\__Sub.Projecy.Directory__\__prodect.name__\__prodect.name__\node_modules\@angular-devkit\build-optimizer\webpack-loader doesn't exist
            .js
              __Projecy.Directory__\__Sub.Projecy.Directory__\__prodect.name__\__prodect.name__\node_modules\@angular-devkit\build-optimizer\webpack-loader.js doesn't exist
            .json
              __Projecy.Directory__\__Sub.Projecy.Directory__\__prodect.name__\__prodect.name__\node_modules\@angular-devkit\build-optimizer\webpack-loader.json doesn't exist
            as directory
              __Projecy.Directory__\__Sub.Projecy.Directory__\__prodect.name__\__prodect.name__\node_modules\@angular-devkit\build-optimizer\webpack-loader doesn't exist
      looking for modules in __Projecy.Directory__\__Sub.Projecy.Directory__\node_modules
        No description file found
        No description file found
        no extension
          __Projecy.Directory__\__Sub.Projecy.Directory__\node_modules\@angular-devkit\build-optimizer\webpack-loader doesn't exist
        .js
          __Projecy.Directory__\__Sub.Projecy.Directory__\node_modules\@angular-devkit\build-optimizer\webpack-loader.js doesn't exist
        .json
          __Projecy.Directory__\__Sub.Projecy.Directory__\node_modules\@angular-devkit\build-optimizer\webpack-loader.json doesn't exist
        as directory
          __Projecy.Directory__\__Sub.Projecy.Directory__\node_modules\@angular-devkit\build-optimizer\webpack-loader doesn't exist
    at BuildError.Error (native)
    at new BuildError (__Projecy.Directory__\__Sub.Projecy.Directory__\__prodect.name__\__prodect.name__\node_modules\@ionic\app-scripts\dist\util\errors.js:16:28)
    at callback (__Projecy.Directory__\__Sub.Projecy.Directory__\__prodect.name__\__prodect.name__\node_modules\@ionic\app-scripts\dist\webpack.js:121:28)
    at emitRecords.err (__Projecy.Directory__\__Sub.Projecy.Directory__\__prodect.name__\__prodect.name__\node_modules\webpack\lib\Compiler.js:269:13)
    at Compiler.emitRecords (__Projecy.Directory__\__Sub.Projecy.Directory__\__prodect.name__\__prodect.name__\node_modules\webpack\lib\Compiler.js:375:38)
    at emitAssets.err (__Projecy.Directory__\__Sub.Projecy.Directory__\__prodect.name__\__prodect.name__\node_modules\webpack\lib\Compiler.js:262:10)
    at applyPluginsAsyncSeries1.err (__Projecy.Directory__\__Sub.Projecy.Directory__\__prodect.name__\__prodect.name__\node_modules\webpack\lib\Compiler.js:368:12)
    at next (__Projecy.Directory__\__Sub.Projecy.Directory__\__prodect.name__\__prodect.name__\node_modules\tapable\lib\Tapable.js:218:11)
    at Compiler.compiler.plugin (__Projecy.Directory__\__Sub.Projecy.Directory__\__prodect.name__\__prodect.name__\node_modules\webpack\lib\performance\SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (__Projecy.Directory__\__Sub.Projecy.Directory__\__prodect.name__\__prodect.name__\node_modules\tapable\lib\Tapable.js:222:13)

Expected behavior:

to build successful

Other information:
Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

cli packages: (C:\Users\nayef.hawa\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.19.1
    ionic (Ionic CLI) : 3.19.1

global packages:

    cordova (Cordova CLI) : 7.0.1

local packages:

    @ionic/app-scripts : 3.1.2
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.9.2

System:

    Node : v6.9.5
    npm  : 5.5.1
    OS   : Windows 10

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : legacy


Most helpful comment

I am going to close this as something that I cannot duplicate.

My attempt to duplicate was with a freshly created "sidemenu" application with no modifications.

You are on an older version of @ionic/app-scripts. Try upgrading (npm i @ionic/[email protected] --save-dev) and trying your build with the newer app-scripts version. That may fix the issue.

If that does not fix the issue, we will need a sample application that we can use to help you debug this issue. If you can provide a sample application via GitHub I will be happy to reopen the issue and have a look.

All 3 comments

I am going to close this as something that I cannot duplicate.

My attempt to duplicate was with a freshly created "sidemenu" application with no modifications.

You are on an older version of @ionic/app-scripts. Try upgrading (npm i @ionic/[email protected] --save-dev) and trying your build with the newer app-scripts version. That may fix the issue.

If that does not fix the issue, we will need a sample application that we can use to help you debug this issue. If you can provide a sample application via GitHub I will be happy to reopen the issue and have a look.

Thanks @kensodemann you saved me, I've spent lot of my time to resolve this problem

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fdnhkj picture fdnhkj  路  3Comments

manucorporat picture manucorporat  路  3Comments

vswarte picture vswarte  路  3Comments

danbucholtz picture danbucholtz  路  3Comments

Nick-The-Uncharted picture Nick-The-Uncharted  路  3Comments