Open Closed

Suite template issue in Angular UI #4314


User avatar
0
ash.jackson created
  • ABP Framework version: v7.0.0
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Steps to reproduce the issue:
  1. Create new micro service pro service template
  2. Open with suite
  3. Define & Generate an entity
  4. Observe Angular compilation error Error: projects/my-service/src/lib/examples/example/components/example.component.ts:8:47 - error TS2307: Cannot find module '../../../proxy/example/models' or its corresponding type declarations.

The two reference paths added to the ExampleComponent are in error:

import type { GetExamplesInput, ExampleDto } from '../../../proxy/example/models';
import { ExampleService } from '../../../proxy/examples/example.service';

If I ask Rider to resolve the references they are replaced with the following:

import { ExampleDto, GetExamplesInput } from '../../../proxy/example-service/examples';
import { ExampleService } from '../../../proxy/example-service/controllers/examples';

The Angular app now compiles and runs.


4 Answer(s)
  • User Avatar
    0
    muhammedaltug created

    Hello,

    Can you send environment.ts file?

  • User Avatar
    0
    ash.jackson created

    environment.ts:

    import { Environment } from '@abp/ng.core';
    
    const baseUrl = 'http://localhost:4200';
    
    const oAuthConfig = {
      issuer: 'https://localhost:44322/',
      redirectUri: baseUrl,
      clientId: 'Angular',
      responseType: 'code',
      scope:
        'offline_access openid profile email phone AccountService IdentityService AdministrationService SaasService ProductService MyService',
      requireHttps: true,
    };
    
    export const environment = {
      production: false,
      application: {
        baseUrl,
        name: 'CloudBiz',
      },
      oAuthConfig,
      apis: {
        default: {
          url: 'https://localhost:44325',
          rootNamespace: 'CloudBiz',
        },
        AbpAccountPublic: {
          url: oAuthConfig.issuer,
          rootNamespace: 'AbpAccountPublic',
        },
        ProductService: {
          url: 'https://localhost:44325',
          rootNamespace: 'CloudBiz',
        },
        MyService: {
          url: 'https://localhost:44325',
          rootNamespace: 'CloudBiz',
        },
      },
    } as Environment;
    
    
  • User Avatar
    0
    muhammedaltug created

    Hello,

    Can you update the MyService configuration like following

    {
    MyService: {
          url: 'https://localhost:44325',
          rootNamespace: 'CloudBiz.MyService',
        },
    }
    
  • User Avatar
    0
    ash.jackson created

    This has solved the issue - I should also add that Suite did not add MyService to environment.ts at all, I did that part manually as part of adding the module to my microservice solution.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38