Google+
Showing posts with label Angular 9. Show all posts
Showing posts with label Angular 9. Show all posts

Friday, December 4, 2020

SOLVED - "An ERROR ocurred while running subprocess cordova" with Angular 9

In this article we review how to solve the error "An ERROR ocurred while running subprocess cordova"  using Angular 9 on Ionic 5,  on an Angular Application that includes references to cordova framework, looking like this :




How to solve the error "An ERROR ocurred while running subprocess cordova"  using Angular 9 on Ionic 5 

Fortunatly, the error message contains a hint about what to do:



To solve the problem, we'll have to re-install Gradle. 
Create a new directory C:\Gradle with File Explorer.
Download Gradle and unpack the Gradle distribution ZIP into C:\Gradle using an archiver tool.


The next step is to configure your system environment, editing the "PATH" environment variable like follows :
Click on "Edit" to edit the "Path" variable, and add the following path to it:
C:\Gradle\gradle-6.5.1\bin



Next, before you try again to compile the app, CLOSE the cmd.exe console, so that it re-reads the now updated environment variables. Compile again :






That's All!!! 
Enjoy Angular.....

      by Carmel Schvartzman

כתב: כרמל שוורצמן

Wednesday, August 26, 2020

SOLVED : Angular 9 ERROR Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

In this article we review how to solve the Angular 9 ERROR 'Critical dependency: require function is used in a way in which dependencies cannot be statically extracted',   looking like this :






How to resolve the Angular 9 ERROR 'Critical dependency: require function is used in a way in which dependencies cannot be statically extracted' using Angular9


That;s an owfully bunch of errors all together to be solved, but that could be misleading. In effect, this errors ocurr just while adding an @Output() variable to your child component , like this :





If you pay closest attention, you'll notice that the reference added to the imports is that of protractor, and not the intended one, from @Angular/core :


That's the source of the whole bunch of errors depicted above.
Just change the import settings to that of the correct one, of @Angular/core :


Perform ng s --port 4200 --base-href   /yourwebsitename/  -o again, and get the success message :






That's All!!! 
Enjoy Angular.....

      by Carmel Schvartzman

כתב: כרמל שוורצמן



















Wednesday, June 10, 2020

Solved : How to fix the Angular 9 error "node_modules/@angular/common/common"' has no exported member 'ViewportScroller'"

In this article we review how to fix the Angular 9 error "node_modules/@angular/common/common"' has no exported member 'ViewportScroller'"  using Angular 9 with Ionic   , looking like this :



Fix the Angular 9 error "node_modules/@angular/common/common" has no exported member 'ViewportScroller' using Angular9


The error description appears as : "Module ':/ionicapp/node_modules/@angular/common/common"' has no exported member 'ViewportScroller'." .
This error happens after you installed the missing router in the Ionic app :

npm install @angular/router  --save

What the error is trying to inform us is, that the versions installed do not comply : the router installed is a different version from the one of the Angular version on your app.

We have to open the PACKAGE.JSON file, and check the versions there :



In this case, version of the @angular/core is 5.2.11, while the @angular/router that was installed, is version 9.1.9 . Of course it wouldn't work. It lacks/requires all kind of methods and properties.

Therefore, remove the router and install it according to the current version on your application:

npm install @angular/router@5.2.11  --save

After the installation, check again the PACKAGE.JSON, to see if version matches :


Now it looks OK. Compile and keep enjoying !!

That's All!!! 
Enjoy Angular.....

      by Carmel Schvartzman

כתב: כרמל שוורצמן