0

We have migrated from ionic v3 to ionic v5 ... ionic serve command working but showing blank page when launched.

ionic build command throwing following error..

[11:57:17] ionic-app-script task: "build" [11:57:17] TypeError: Cannot read property 'compilation' of undefined TypeError: Cannot read property 'compilation' of undefined at DefinePlugin.apply (/Users/upgrade/node_modules/webpack/lib/DefinePlugin.js:280:18) at Compiler.apply (/Users/upgrade/node_modules/@ionic/app-scripts/node_modules/tapable/lib/Tapable.js:375:16) at webpack (/Users/upgrade/node_modules/@ionic/app-scripts/node_modules/webpack/lib/webpack.js:33:19) at /Users/upgrade/node_modules/@ionic/app-scripts/dist/webpack.js:132:24 at new Promise () at runWebpackFullBuild (/Users/upgrade/node_modules/@ionic/app-scripts/dist/webpack.js:113:12) at webpackWorker (/Users/upgrade/node_modules/@ionic/app-scripts/dist/webpack.js:70:19) at Object.webpack (/Users/upgrade/node_modules/@ionic/app-scripts/dist/webpack.js:29:12) at bundleWorker (/Users/upgrade/node_modules/@ionic/app-scripts/dist/bundle.js:13:22) at Object.bundle (/Users/upgrade/node_modules/@ionic/app-scripts/dist/bundle.js:6:12) [ERROR] An error occurred while running subprocess ionic-app-scripts.

    ionic-app-scripts build exited with exit code 1.
    
    Re-running this command with the --verbose flag may provide more information.

we need to use this project for all 3 platform i.e. browser, android and ios .. so for that purpose we need www folder with files. ionic build command achieve this.

how should i fix this ...

Dnyanesh
  • 331
  • 3
  • 12
  • i don't know how u did your migration or what plugins u use or anything so its not clear enough, but if you believe your plugins are right and everything in your project app directory is done right, then create a new project which will generate nodemodules folder and package.json, then start copying files from old to new (first app folder, then check if u got things in index.html to new project but not the file itself since things changed with structuring so just in case u got additional scripts etc..., and then global.cscc and them theme variables, then in package.json copy lines of plugins) – Mostafa Harb Nov 22 '22 at 11:00
  • and after you copy lines of plugins to new project, run npm install and it should install new dependencies and after that hopefully you can build your project – Mostafa Harb Nov 22 '22 at 11:00

1 Answers1

0

Create a new project using ionic 6, migrate cordova plugins to capacitor and copy over code. This is your best bet. Goodluck.