Upgrade to ionic versions 2.0.0

My project was originally built using:

  • ionic: 2.0.0-rc.3
  • ionic-app-scripts: 0.0.45

After upgrading to:

  • ionic: 2.0.0 (which looks just like 2.0.0-rc.6 )
  • ionic-app-scripts: 1.0.0

I meet a lot of errors:

screengrab of errors

I reviewed ionic changelog and ionic-app-scripts alone , but nothing stands out.

I assume the errors are related to ionic-app-scripts (like that directory in node_modules ) that it is looking at, but I'm not sure what it might be.

When running ionic info :

 Cordova CLI: 6.5.0 Ionic Framework Version: 2.0.0 Ionic CLI Version: 2.2.1 Ionic App Lib Version: 2.2.0 Ionic App Scripts Version: 1.0.0 ios-deploy version: Not installed ios-sim version: Not installed OS: Windows 10 Node Version: v7.4.0 Xcode version: Not installed 

EDIT:

This is my package.json :

 "dependencies": { "@angular/common": "2.4.5", "@angular/compiler": "2.4.5", "@angular/compiler-cli": "2.4.5", "@angular/core": "2.4.5", "@angular/forms": "2.4.5", "@angular/http": "2.4.5", "@angular/platform-browser": "2.4.5", "@angular/platform-browser-dynamic": "2.4.5", "@angular/platform-server": "2.4.5", "@ionic/storage": "1.1.7", "@types/jasmine": "^2.5.40", "@types/lodash": "^4.14.50", "angular2-google-maps": "0.17.0", "angularfire2": "^2.0.0-beta.6", "clean-css": "^4.0.2", "firebase": "^3.6.4", "ionic-angular": "2.0.0", "ionic-native": "2.4.1", "ionicons": "3.0.0", "lodash": "^4.17.4", "rxjs": "^5.0.0-beta.12", "zone.js": "0.7.6" }, "devDependencies": { "@ionic/app-scripts": "1.0.0", "typescript": "2.1.5" }, 

EDIT # 2:

If I copy packages.json from the working template into my project (and make a new installation of node_modules ), I get the same error as before. This is clearly a bug with @ionic/app-scripts since I ran npm run build (as described here ) and that where the error (s) appear.

Since the error (errors) occurred only when copying in my src folder, it should be something with my project, since it was written using 0.0.45 , and not 1.0.0 @ionic/app-scripts . Is there a way to debug and find where the error is?

Also (although the template works), when you virtual-file-utils.d.ts clean-css-factory.d.ts and virtual-file-utils.d.ts , do the same errors exist, although it builds and works just fine?

Note: When you run npm run build console logs in before:

 > ionic-hello-world@ build E:\Documents\Year_3\Mobile_Application_Development\mammoth-v2 > ionic-app-scripts build [15:41:38] ionic-app-scripts 1.0.0 [15:41:38] build dev started ... [15:41:38] clean started ... [15:41:38] clean finished in 3 ms [15:41:38] copy started ... [15:41:38] transpile started ... **errors occur from here** 

DECISION:

I found a solution to the original problem. There was an unused import of a module that no longer exists (due to the new version of @ionic/app-scripts ), which was:

import { transformSrcPathToTmpPath } from "@ionic/app-scripts/dist";

0
source share
2 answers

The solution was that I had an unused import that was looking for a module in @ionic/app-scripts that no longer exists (was from 0.0.45 and does not exist at 1.0.0 ).
The module he was looking for was transformSrcPathToTmpPath in @ionic/app-scripts/dist

0
source

Have you tried to remove node Modules?

 rm -rf node_modules 

Do you have the last Kli?

 npm uninstall -g ionic npm install -g ionic 

Change your package.json package to the following

 "dependencies": { "@angular/common": "2.2.1", "@angular/compiler": "2.2.1", "@angular/compiler-cli": "2.2.1", "@angular/core": "2.2.1", "@angular/forms": "2.2.1", "@angular/http": "2.2.1", "@angular/platform-browser": "2.2.1", "@angular/platform-browser-dynamic": "2.2.1", "@angular/platform-server": "2.2.1", "@ionic/storage": "1.1.7", "ionic-angular": "2.0.0-rc.5", "ionic-native": "2.2.11", "ionicons": "3.0.0", "rxjs": "5.0.0-beta.12", "zone.js": "0.6.26", "sw-toolbox": "3.4.0" }, "devDependencies": { "@ionic/app-scripts": "1.0.0", "typescript": "2.0.9" } 

As a last resort, you can create a new ionic application and then move all your code

 ionic start newApp --v2 --ts 
0
source

Source: https://habr.com/ru/post/1014513/


All Articles