Open Closed

[BUG] - Host Application is not generation proxy for Angular DDD (module) #9598


User avatar
0
start created

Hi,

I gave Sümeyye Kurtuluş and liming ma aleardy access to that project

in the Host-Application I used "abp generate-proxy -t ng -m cards" to generate the proxy, but he only generated the sample API and not the actual "AppService" from the module.

I even removed the "SampleController" in the library, hoping the proxy would find its right API.

Just a quick update — I believe the current assumption is that the developer sets up the proxy within the host application, which is then used inside the Angular library (DDD). However, the actual API is exposed via the ModuleXXX.HttpApi.Host through its xxxController, not directly from the host application's IApplicationService.

If that’s the intended setup, it looks ABP Studio didn’t generate the paths.proxy configuration in the tsconfig files for either the host or the module. Because of this, I’m currently running into issues identifying the correct import path.

  • Template: app
  • Created ABP Studio Version: 1.0.2
  • Current ABP Studio Version: 1.0.2
  • Tiered: Yes
  • Multi-Tenancy: Yes
  • UI Framework: angular
  • Theme: leptonx
  • Theme Style: dark
  • Theme Menu Placement: top
  • Run Install Libs: Yes
  • Progressive Web App: No
  • Run Progressive Web App Support: No
  • Database Provider: ef
  • Database Management System: sqlserver
  • Separate Tenant Schema: No
  • Create Initial Migration: Yes
  • Run Db Migrator: Yes
  • Mobile Framework: none
  • Public Website: No
  • Social Login: Yes
  • Include Tests: Yes
  • Kubernetes Configuration: Yes
  • Distributed Event Bus: rabbitmq
  • Use Local References: No
  • Optional Modules:
    • GDPR
    • FileManagement
    • TextTemplateManagement
    • LanguageManagement
    • AuditLogging
    • Chat
    • OpenIddictAdmin
  • Selected Languages: Deutsch (Deuthschland), English, 简体中文, Español, العربية, हिन्दी, Português (Brasil), Français, Русский, Türkçe, Italiano, Čeština, Magyar, Română (România), Svenska, Suomi, Slovenčina, Íslenska, 繁體中文
  • Default Language: Deutsch (Deuthschland)
  • Create Command: abp new xxx -t app --tiered --ui-framework angular --database-provider ef --database-management-system sqlserver --theme leptonx --without-cms-kit --sample-crud-page --dont-run-bundling -chat -file-management

3 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • When using ABP's Angular service proxy generation for a DDD/module-based solution, the proxy generator only creates proxies for HTTP APIs that are exposed and discoverable by the backend's API definition endpoint. If your AppService from the "cards" module is not being generated, check the following:
    1. Ensure the AppService is Publicly Exposed

      • The AppService must be registered and exposed via the auto API controller system.
      • It should be decorated with the appropriate attributes (e.g., [RemoteService] or [ApiController] if needed) and reside in a namespace that is included in the API definition.
    2. Module Must Be Properly Integrated

      • The module (e.g., Gaming.Module.Cards) must be added as a dependency in your Host application and properly configured in the module system.
    3. Backend Host Must Be Running

      • The backend (HttpApi.Host) must be running and accessible when you run abp generate-proxy.
      • If using Visual Studio, do not use IIS Express; run the Host project directly.
    4. Correct Module Name in Command

      • The -m cards parameter should match the remote service/module name as registered in your backend.
      • You can check the available remote service names by visiting /api/abp/api-definition on your running backend.
    5. Check API Definition Endpoint

      • Visit https://<your-host>/api/abp/api-definition?includeTypes=true to verify if your AppService endpoints are listed. If not, the proxy generator will not generate them.
    6. Re-run Proxy Generation

      • After confirming the above, run:
        abp generate-proxy -t ng -m cards
        
      • If you have multiple modules, ensure you specify the correct one.
    7. Check for Errors or Warnings

      • Review the CLI output for any errors or warnings about missing modules or services.

    If your AppService is still not being generated, ensure that:

    • The service is not internal/private.
    • The module is referenced and loaded in the Host's module dependency tree.
    • The service is not excluded by any configuration.

    For more details, see:


    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

  • User Avatar
    0
    start created

    Didnt work. take a look at the code.

    Write me in private, not in that public place

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

    Hello, thank you for providing necessary and extra information regarding your problem. I checked your project, however I could not see the module.

    !-- removed picture --!

    Regardless of the module, I can suggest you to discard proxy paths. Here is how paths are generated within the latest version of ABP studio:

    // angular/tsconfig.json
    {
    ...
        "paths": {
          "@angular/*": ["node_modules/@angular/*"],
          "@abp/*": ["node_modules/@abp/*"],
          "@volo/*": ["node_modules/@volo/*"],
          "@volosoft/*": ["node_modules/@volosoft/*"],
          "@swimlane/*": ["node_modules/@swimlane/*"],
          "@ngx-validate/core": ["node_modules/@ngx-validate/core"],
          "@ng-bootstrap/ng-bootstrap": ["node_modules/@ng-bootstrap/ng-bootstrap"],
          "@book-store": ["../modules/bookstore/angular/projects/book-store/src/public-api.ts"],
          "@book-store/config": [
            "../modules/bookstore/angular/projects/book-store/config/src/public-api.ts"
          ]
        },
    ...
    }
    
    

    You can directly use the relative path as follows:

    import type { BookStoreEntityOneDto } from '../../../proxy/book-store-entity-ones/models';
    import { BookStoreEntityOneService } from '../../../proxy/book-store-entity-ones/book-store-entity-one.service';
    export abstract class AbstractBookStoreEntityOneDetailViewService {
    	// ...
    }
    

    You can let me know if you need further assistance. Thank you for your cooperation.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 01, 2025, 08:37