We encountered a BuildError.Error while using Ionic 3 on Android

After setting up my Ionic 3 configuration with

@ionic/app-scripts: 3.1.1 typescript: 2.4.2

and installing the necessary dependencies

@angular/common: 5.0.1 @angular/compiler: 5.0.1 @angular/compiler-cli: 5.0.1 @angular/core: 5.0.1 @angular/forms: 5.0.1 @angular/http: 5.0.1 @angular/platform-browser: 5.0.1 @angular/platform-browser-dynamic: 5.0.1 @ionic-native/call-number: ^4.5.2 @ionic-native/camera: ^4.5.2 @ionic-native/core: 4.3.1 @ionic-native/splash-screen: 4.4.0 @ionic-native/status-bar: 4.4.0 @ionic/app-scripts: 3.1.1 @ionic/storage: 2.1.3

My Ionic 3 project successfully builds using the commands:

ionic cordova build --release android 
ionic cordova build android

However, when attempting:

ionic cordova build android --prod --release 
ionic cordova build android --release --prod

An error is generated showing:

Error: ./node_modules/Rxjs/observable/BoundNodeCallbackObservable.js
Module build failed: TypeError: Cannot read property 'type' of undefined
at Object.getEffectiveTypeAnnotationNode (typescript.js:9341:17)
at assignContextualParameterTypes (typescript.js:41652:25)
at checkFunctionExpressionOrObjectLiteralMethod (typescript.js:41948:29)
at checkExpressionWorker (typescript.js:42959:28)
at checkExpression (typescript.js:42898:42)
at checkExpressionCached (typescript.js:42779:38)
at checkReturnStatement (typescript.js:45418:54)
at checkSourceElement (typescript.js:46763:28)
at Object.forEach (typescript.js:1506:30)
at checkBlock (typescript.js:44563:16)

Answer №1

The solution is to update to version 3.1.1 of @ionic/app-scripts. The issue was fixed in this version after being discovered in 3.1.0.

For more details, check out this link

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

When trying to access a certain class property, I was met with the following error message: TypeError: Unable to read/set property 'x' of

Lately, I've delved into the realm of JavaScript / TypeScript and decided to create a basic React App using TypeScript. Within one of my components, I aim to switch between different components using a "state" (where each component will follow the pre ...

Troubleshooting ReactJs in Chrome during page load: encountering issues with undefined properties when utilizing the console

When debugging React on initial page load, I encounter a problem. Upon hovering over this, I can see the content, but using the console shows that this is undefined. Interestingly, this issue only arises when I refresh the page; clicking around does not tr ...

JS The clipboardData in ClipboardEvent is perpetually void

I am trying to retrieve files using CTRL+V from the ClipboardEvent in Angular6, but I am encountering an issue where the clipboardData is always empty regardless of whether I test images or text. This problem persists even when tested on the latest release ...

Can the router accommodate multiple loadChildrens at once?

I recently upgraded to the latest version of angular 2 and discovered an interesting lazy load feature utilizing loadChildren. Let me illustrate with a simple example export const routes: Routes = [ { path: 'crisis', loadChildren: 'app/c ...

Route Angular 4 application static resources to a /PORT directory rather than the primary domain

Our Angular 4 application is integrated within a Node + Express app and started like a typical node app, such as: node index.js On a local machine, the Angular app is served from the /client directory: app.use(express.static(__dirname + "/client")); Onc ...

After updating my Angular version from 8 to 9, an error has been thrown stating "It is not possible to assign the value 'undefined' to the template variable 'limit'"

Recently, I made updates to my Angular 8 project by switching it to the newest version of Angular 9. In one of the template's div elements, I declared a variable and everything seemed to be functioning correctly without any errors. To avoid initializi ...

Using ngrx store select subscribe exclusively for designated actions

Is it possible to filter a store.select subscription by actions, similar to how we do with Effects? Here is an example of the code in question: this.store .select(mySelector) .subscribe(obj => { //FILTER SUBSCRIPTION BY ACTION this.object = ob ...

An issue has been detected with the width attribute in Typescript when using

I have a question regarding the TypeScript error related to the width property. I've created a component called ProgressBar where I'm using Stitches for styling. However, TypeScript is throwing an error even when I specify the type as ANY. impor ...

Exploring Angular14: A guide to efficiently looping through the controls of strictly typed FormGroups

Currently, I am working on upgrading my formGroups to be strictly typed in Angular v14. Within my FormGroup, there is a specific block of logic that iterates through all the controls and performs an action (this part is not crucial as I am facing issues be ...

ng-bootstrap Datepicker with current date displayed as a placeholder

I have been using ng-bootstrap Datepicker and have implemented it like demonstrated in this example on Plunker. <div class="input-group"> <input class="form-control" placeholder="yyyy-mm-dd" name="dp" [(ngModel)]="model" ngbDatepicker ...

There was an error in calling `prisma.user.findUnique()`:

Here is my code snippet for the API route: export const POST = async (req: NextRequest) => { ... try { const { email, name, password } = await req.json(); console.info(email, name, password); const existingUser = await prismadb.user.findUn ...

Error occurs because the declaration for `exports` is missing in the compiled TypeScript code

I am currently venturing into the world of typescript and I've encountered a problem while attempting to run my application. An error is popping up, stating ReferenceError: exports is not defined The code I have written is rather straightforward: / ...

When ng-test is executed in an Angular service, the function array.some is not found

After retrieving allUsers from the cache and initializing it, I then set the boolean value of specialUserExists based on a condition in allUsers using allUsers.some() (reference to the Array.prototype.some() method). service.ts @Injectable({ providedIn: ...

Transfer your focus to the following control by pressing the Enter key

I came across a project built on Angular 1.x that allows users to move focus to the next control by pressing the Enter key. 'use strict'; app.directive('setTabEnter', function () { var includeTags = ['INPUT', 'SELEC ...

What is the best way to incorporate a WYSIWYG Text Area into a TypeScript/Angular2/Bootstrap project?

Does anyone know of a WYSIWYG text editor for TypeScript that is free to use? I've been looking tirelessly but haven't found one that meets my needs. Any recommendations or links would be greatly appreciated. Thank you in advance! ...

Tips for sending Angular objects to the backend using a GET request?

I am encountering an issue when attempting to pass custom objects from Angular to the backend using a GET request. When using custom objects in the backend, I am receiving null values for all properties. What are the correct methods for passing objects in ...

Utilizing a combination of 100% stacked area and column chart series, ensure that the value axis is based solely on the column series values

I am looking to create a chart that combines a 100% stacked area series as an underlay with a column series. The stacked area series values should be either 1 or null, indicating whether to fill vertically or not display. I want the value axis to only cons ...

Can a type alias be created for more than one parameter of a class or function with multiple type parameters?

When using Vue, there are situations where a generic function may require 3, 4, or even 5 type parameters. Is it possible to create a type alias for these parameters in order to avoid typing them out repeatedly? Something like this perhaps: // Example of ...

Displaying Image Preview in Angular 2 After Uploading to Firebase Storage

At the moment, I am facing an issue where the uploaded image is not being displayed after the uploadTask is successful. This problem arises due to the asynchronous loading nature of the process, causing the view to attempt to display the image before the u ...

A guide on combining two native Record types in TypeScript

Is it possible to combine two predefined Record types in TypeScript? Consider the two Records below: var dictionary1 : Record<string, string []> ={ 'fruits' : ['apple','banana', 'cherry'], 'vegeta ...