Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.
This repository was archived by the owner on May 1, 2020. It is now read-only.

Using --prod causes error in app #780

Closed
@bilalsoomro

Description

@bilalsoomro

Short description of the problem:

My build created using --prod and --release flags gets stuck at startup due to the following error which I captured in logcat.

file:///android_asset/www/build/main.js: Line 29 : Uncaught Error: Module build failed: Error: ENOENT: no such file or directory, open '/Users/***/ionic2app/src/pages/react-page/react-page.js' at Error (native)

What behavior are you expecting?

The build to work like a normal --release build with the --prod optimizations

Steps to reproduce:

  1. Created a custom webpack config and added it to my package.json like this...
"config": {
   "ionic_webpack": "./webpack.config.js"
 }
  1. Inside my custom config, I added support for tsx by changing one of the module loader for ts
{
  test: /\.(ts|tsx)$/,
  loader: process.env.IONIC_WEBPACK_LOADER
}
  1. Created a page, imported react and changed the file extension to tsx to I can use react's render functionality. When I run "ionic run android", it is able to build a debug version of the app and run on my device. I can also run "ionic build android --release" to build an unsigned apk. But when I run "ionic build android --release --prod" to optimize my ionic2 app, the app has an error inside the assets/www/build/main.js file saying that my page.js is missing. It seems like it didnt get added to my bundled main.js properly.

Which @ionic/app-scripts version are you using?
1.1.4

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
My ionic version is....
"ionic-angular": "2.1.0"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions