Starts in:
2 DAYS
0 HR
32 MIN
35 SEC
Starts in:
2 D
0 H
32 M
35 S
Open Closed

abp generate-proxy generates extra imports after updating abp 8 #7659


User avatar
0
JanneHarju created
  • ABP Framework version: v8.2.1
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): separeted
  • Exception message and full stack trace: -
  • Steps to reproduce the issue:

When I generate proxies for my angular application files are broken because of broken imports. I have noticed that it might be related to PagedResultDto<T> So make endpoint which returns object which extends PagedResultDto<MyObject> then generate proxies like this: abp generate-proxy -t ng -m app --target MyProject -a default Then you noticed that in model file there is extra import for MyObject even when MyObject is declared in same file. Here is one example of our proxy model:

import type { VendorDto } from '../scm/master-data-management/vendors/models';
import type { PagedResultDto } from '@abp/ng.core';
import type { CalculatedOrderProposalSummaryItemDto } from './models';
import type { OrderProposalFocusBarValuesDto } from '../order-proposal-focus-bar-values/models';

export interface CalculatedOrderProposalSummaryItemDto {
  vendor: VendorDto;
  vendorGroupName?: string;
}

export interface PagedOrderProposalSummaryItemResultDto extends PagedResultDto<CalculatedOrderProposalSummaryItemDto> {
  focusBarValues: OrderProposalFocusBarValuesDto;
  calculationDate?: string;
}

So here CalculatedOrderProposalSummaryItemDto is imported even that it is declared in same file. So fix would be don't import interface when it is declared in same file.

This started to happend after we upgraded from abp 7 to abp 8.


5 Answer(s)
  • User Avatar
    0
    JanneHarju created

    I found this similar Support ticket. https://abp.io/support/questions/6657/Generation-of-Service-Proxies-for-Angular-not-handling-subclasses-of-PagedResultDtoT-correctly Last answer is not acceptable. At least you need to try fix it. Or say you will at future.

  • User Avatar
    0
    sumeyye.kurtulus created
    Support Team Angular Expert

    Hello, this specific proxy generation problem could have been solved within this release by this fix.

    If you think that your case is different, you can provide more detail so that I can assist you further.

  • User Avatar
    0
    JanneHarju created

    Hello, I did assume as well that this was same bug but apparently is isn't. Because as you can se I'm working already 8.2.1 version. Try to create this kind of endpoint: [HttpGet] public virtual Task<PagedResultDto<MyDto>> GetListAsync() { return _myAppService.GetListAsync(); } And then generate proxies with this tool of yours like this: abp generate-proxy -t ng -m app --target MyApplication -a default

  • User Avatar
    0
    sumeyye.kurtulus created
    Support Team Angular Expert

    Hello, thank you for providing more details. I have created and tried to produce the same problem with this DTO and this endpoint. However, I have not reproduced the same issue. If the problem persists, you can share a sample project within this e-mail address sumeyye.kurtulus@volosoft.com

  • User Avatar
    0
    JanneHarju created

    Ok. So my assumption was incorrect. I will try to discover and find similarities from all problematic proxies to identify what could make them beahave differently from others. I'm not sure do I have time reserved to make example project now. I will inform this to my product officer.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06