I am using the CRUD Page Generator to produce models and it appears that the generated output is expecting the proxy path for the Angular service to be under a "controllers" folder; however, they are being generated just in the root HttpApi project instead. This error sounds very similar to issue reported in 2021: https://github.com/abpframework/abp/issues/9904
// Generated path below:
import { WorkAreaService } from '../../../proxy/core/controllers/work-areas/work-area.service';
// Correct path that it should be:
import { WorkAreaService } from '../../../proxy/core/work-areas/work-area.service';
export abstract class AbstractWorkAreaViewService {
protected readonly proxyService = inject(WorkAreaService);
protected readonly confirmationService = inject(ConfirmationService);
protected readonly list = inject(ListService);
data: PagedResultDto<WorkAreaDto> = {
items: [],
totalCount: 0,
};
filters = {} as GetWorkAreasInput;
delete(record: WorkAreaDto) { ... }
hookToQuery() { ... }
clearFilters() { ... }
}
Not sure if the WorkArea should be under Core.Http > Controllers > WorkAreas
but when the CRUD generator is run (and re-run), it's placing the WorkArea controller service under Core.Http > WorkAreas
:
- Exception message and full stack trace:
- Steps to reproduce the issue:
2 Answer(s)
-
0
Hi, thanks for reporting this. Indeed, it should be under the controllers folder. I'll create an issue for that, but can you share your solution structure, so we can better test it?
-
0
Hi, I just created a project from scratch, upgraded to 9.2.0-rc.2, and then save and generated a new CRUD page with the generator (named WorkArea) and unfortunately wasn't able to reproduce the issue.
The following worked fine as expected when generated WorkArea in the MAIN project:
- Generated service file is located here: Abp9166\angular\src\app\proxy\work-areas\work-area.service.ts
- Generated service file (Abp9166\angular\src\app\work-areas\work-area\services\work-area.abstract.service.ts) references import as:
import { WorkAreaService } from '../../../proxy/work-areas/work-area.service';
(no controller in path)
So it seems that there is something misconfigured perhaps from my older project based on an earlier 9.0.3 ABP version I think?
Workaround that seemed to work for me:
- I've copied the the folder under
angular\.suite\schematics
from the new project to my old project and deleted thegenerate-proxy.json
from thesrc\proxy\
folder and it seems to be generating the path correctly now without thecontrollers
in the path.