The angular build prod function was expecting 2 arguments, but only 1 argument was provided

When I serve my Angular app normally, everything works fine. But when I try to serve it in production mode, I encounter this error that is leaving me quite perplexed.

//error on build: Expected 2 arguments, but got 1.

<ion-col class="ion-no-padding" size-md="12" size-lg="12" size-sm="12" size-xs="12" 
*ngFor="let i=index; let post of person$ | async | sortPipe">

page.ts

 //vars;
  personSubject = new ReplaySubject<any>(1);
  person$: Observable<any> = this.personSubject.asObservable();
  private destroy$ = new Subject();

 getAllPosts() {
    this.authService.getAllPosts().pipe(takeUntil(this.destroy$)).subscribe((res: any) => {

      const length = res.length;
      console.log(length);

      this.getFullPosts = res.data.post;
      this.personSubject.next(res.data.post)
      this.userGallery = res.data.post.forEach(img => {
        img.galleryImages = img.images.map(image => {
          return new ImageItem({ src: image, thumb: image });
        });

      

      })
    });

Answer №1

Issue Resolved!

I found that I was missing some property declarations in my SortPipe.

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

Integrate worldwide sass into Angular 4 using webpack

I'm facing an issue with my Angular 4 project that uses webpack with HMR. Just to note, I am integrating it with ASP Core 2 using the angular template. My goal is to create a global/main SCSS file that will be applied to all components. I want this S ...

What is the best approach to utilizing directives across multiple modules within Angular?

Recently, I created a directive called uppercase-input.directive.ts I attempted to import and use this directive in multiple components, but encountered the following error I have only shared one file here (organization.module.ts), but there are several ot ...

What is the best way to assign a type based on a variadic type in TypeScript?

TypeScript playground link For my current project, I am designing a custom route handler creator for Express. The goal is to allow passing arbitrary assertions as initial arguments before invoking the route handler callback. Here's an example of how ...

The Java AWS Lambda function is returning an empty JSON response in the body

I am utilizing the Angular application https://github.com/Kyro1980/timeout-app-public and integrating the Payment Intents API for complex payment flows with Stripe. In this process, I send a PaymentIntent (Stripe) to AWS Lambda and attempt to fetch a respo ...

How can TypeScript rules be incorporated into a Next.js project without compromising next/core-web-vitals?

In my current NextJS project which is in typescript, I have the following configuration in my .eslintrc.json: { "extends": "next/core-web-vitals" } Now, I want to include additional typescript rules, such as enforcing the rule of n ...

Angular Module Federation -- The shared module is currently inaccessible for immediate use

Encountering a problem while attempting to execute tests on my Angular microfrontend for use within Module Federation. Using Angular 12 and Webpack 5. Uncaught Error: Shared module is not available for eager consumption: 5487 Any suggestions on how to co ...

Creating a numeric sequence based on the date of a corresponding transaction - a step-by-step guide

INTRO I built an e-commerce app with TypeScript and Sequelize ORM. In the app, I have a table that generates sequential invoice numbers based on the current day. CREATE TABLE `dm_generate_trx` ( `id` int NOT NULL AUTO_INCREMENT, `date` date NOT NULL, ...

Customizing table header sort icons in PrimeNG 15.4+: A step-by-step guide

The most recent update in PrimeNG brought about a change in the way sort icons are implemented. Previously, they used an i tag with CSS classes which could be customized easily using my company's icons: https://i.sstatic.net/f0Nrq.png However, the n ...

Exploring different ways to customize the grid style in Angular 6

Here is the style I am working with: .main-panel{ height: 100%; display: grid; grid-template-rows: 4rem auto; grid-template-columns: 14rem auto; grid-template-areas: 'header header''sidebar body'; } I want to know how to cha ...

Solana Metaplex Maker Dispute Resolved

Currently experimenting with the Metaplex Storefront, I have incorporated 2 whitelisted wallets for my auction page through the admin section (one of which was used to initialize the page). I conducted a test auction with this particular NFT () that has 2 ...

Is it possible to eliminate additional properties from an object using "as" in Typescript?

I am looking for a way to send an object through JSON that implements an interface, but also contains additional properties that I do not want to include. How can I filter out everything except the interface properties so that only a pure object is sent? ...

Null value returned by getDOM() function during transition from Angular 2 to Angular 4

I've encountered a unique challenge that has me stumped. Despite finding similar issues, the proposed solutions don't seem to work for my case. My issue arose when I decided to migrate a project from Angular 2 to Angular 4. I began by creating a ...

Retrieving information using React Query in TypeScript

When working with React Query and TypeScript, I encountered an issue with the getRecommendations hook. I wanted to only send the latest recommendations (I may create another hook for watchlist items in the future). The error I received was related to the q ...

I encountered an error stating "Buffer is not defined" originating from the Deode/Encode Stream Bundle.js script, not from my own code

I've encountered a major issue while attempting to update my npm project to webpack 5, and now I'm left with just one persistent error: bundle.js:1088566 Uncaught ReferenceError: Buffer is not defined at bundle.js:1044980:24 ...

Typescript is throwing an error when trying to use MUI-base componentType props within a custom component that is nested within another component

I need help customizing the InputUnstyled component from MUI-base. Everything works fine during runtime, but I am encountering a Typescript error when trying to access the maxLength attribute within componentProps for my custom input created with InputUnst ...

What is the best way to include a button at the bottom of a Material UI table?

I've been working with Material UI in React TypeScript and I'm having trouble adding a button at the bottom that leads to a form. Despite my attempts, I haven't been successful. Can someone please help me with this? I just need a simple butt ...

Variations in key options based on specific situations

Is it possible to make certain keys required in Typescript depending on the circumstances? For instance interface IDog { name: string; weight: number; } class Retriever implements IDog { name = "Dug"; weight = 70; public updateAttribute(props ...

Can we utilize the elements in Array<keyof T> as keys in T?

Hello, I am trying to develop a function that accepts two parameters: an array of objects "T[]" and an array of fields of type T. However, I am encountering an issue when I reach the line where I invoke el[col] Argument of type 'T[keyof T]' i ...

Angular unit testing - Accessing child components within an overlay container

I've created a unique custom component called MatSelectControls. Its implementation looks like this: <component-im-testing> <mat-select> <mat-select-controls></mat-select-controls> <mat-option *ngFor="..."> ...

Applying these sorting functions to my specific scenario

Hello everyone, I hope you can help me out with this issue. I have been struggling for hours trying to sort my array of objects in JavaScript based on a specific property, but I just can't seem to get it right. I have referred to some of the top post ...