-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Is there an existing issue for this?
- I have searched the existing issues
Description
When generating Angular proxies, ABP generates an unnecessary (and invalid) self-import inside the generated models.ts.
If a DTO type is declared in the same namespace (thus generated into the same models.ts file), the generator still emits an import like:
import type { TransactionDto } from './models';But this line is inside models.ts itself, so it becomes a self-import and causes an Angular/TypeScript compile-time error.
This seems to happen when a custom DTO inherits from PagedResultDto and uses a DTO type parameter T that is in the same namespace.
Reproduction Steps
Create the following DTO in your Http API / Application Contracts layer (example):
public class TransactionDto { }
public class TransactionPagedResultDto : PagedResultDto<TransactionDto>
{
public List<TransactionAmountSummary> AmountSummary { get; set; } = []; // or it could be more simple like int
}Ensure TransactionPagedResultDto and TransactionDto are in the same C# namespace.
Use it as a return type of an endpoint:
[HttpGet]
public virtual async Task<TransactionPagedResultDto> GetListAsync()
{
...
}Generate Angular proxies (ABP CLI / proxy generate workflow).
Expected behavior
models.ts contains a self-import similar to:
import type { TransactionDto } from './models';This causes Angular/TypeScript compilation to fail (self-referencing module import).
Actual behavior
build error.
Regression?
No response
Known Workarounds
after the abp generate-proxy -t ng. Remove the line on models.ts
Version
9.3.5
User Interface
Angular
Database Provider
EF Core (Default)
Tiered or separate authentication server
None (Default)
Operation System
macOS
Other information
No response