Open Closed

Angular app fails to compile after upgrade #7787


User avatar
0
dmannion created
  • ABP Framework version: v8.2.2
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace: see below
  • Steps to reproduce the issue: After upgrading from 8.0.3 to 8.1.0, generating Angular proxies results too many errors to be usable. I believe this is a known bug. Further upgrading from 8.1.0 to 8.2.2, generating generating Angular proxies results in fewer errors and if I manually fix all the incorrectly generated classes, it still fails to compile because of the top three errors below:

./node_modules/@volo/abp.ng.account/fesm2022/volo-abp.ng.account-public.mjs:5002:26-31 - Error: export 'model' (imported as 'model') was not found in '@angular/core' ...

./node_modules/@volo/abp.ng.identity/fesm2022/volo-abp.ng.identity.mjs:3765:26-31 - Error: export 'model' (imported as 'model') was not found in '@angular/core' ...

./node_modules/@volo/abp.ng.identity/fesm2022/volo-abp.ng.identity.mjs:3828:26-31 - Error: export 'model' (imported as 'model') was not found in '@angular/core' ...

Error: src/app/proxy/dci/aggregator/organizations/models.ts:4:15 - error TS2724: '"../../../volo/saas/tenant-activation-state.enum"' has no exported member named 'SaasTenantActivationState'. Did you mean 'TenantActivationState'?

4 import type { SaasTenantActivationState } from '../../../volo/saas/tenant-activation-state.enum';


src/app/proxy/volo/saas/tenant-activation-state.enum.ts:3:13 3 export enum TenantActivationState {


'TenantActivationState' is declared here.

Error: src/app/proxy/dci/aggregator/organizations/models.ts:13:20 - error TS2304: Cannot find name 'TenantActivationState'.

13 activationState: TenantActivationState;



Error: src/app/proxy/dci/aggregator/organizations/models.ts:26:20 - error TS2304: Cannot find name 'TenantActivationState'.

26 activationState: TenantActivationState;



Error: src/app/proxy/dci/aggregator/organizations/models.ts:47:20 - error TS2304: Cannot find name 'TenantActivationState'.

47 activationState: TenantActivationState;



Error: src/app/proxy/dci/aggregator/users/custom-identity-user.service.ts:4:197 - error TS2305: Module '"../../../volo/abp/identity/models"' has no exported member 'IdentityRoleDto'.

4 import type { ClaimTypeDto, DownloadTokenResultDto, ExternalLoginProviderDto, GetIdentityUserListAsFileInput, GetIdentityUsersInput, GetImportInvalidUsersFileInput, GetImportUsersSampleFileInput, IdentityRoleDto, IdentityRoleLookupDto, IdentityUserClaimDto, IdentityUserCreateDto, IdentityUserDto, IdentityUserUpdateDto, IdentityUserUpdatePasswordInput, IdentityUserUpdateRolesDto, ImportExternalUserInput, ImportUsersFromFileInputWithStream, ImportUsersFromFileOutput, OrganizationUnitDto, OrganizationUnitLookupDto, OrganizationUnitWithDetailsDto } from '../../../volo/abp/identity/models';



Error: src/app/proxy/dci/aggregator/users/custom-identity-user.service.ts:4:282 - error TS2724: '"../../../volo/abp/identity/models"' has no exported member named 'IdentityUserDto'. Did you mean 'IdentityUserClaimDto'?

4 import type { ClaimTypeDto, DownloadTokenResultDto, ExternalLoginProviderDto, GetIdentityUserListAsFileInput, GetIdentityUsersInput, GetImportInvalidUsersFileInput, GetImportUsersSampleFileInput, IdentityRoleDto, IdentityRoleLookupDto, IdentityUserClaimDto, IdentityUserCreateDto, IdentityUserDto, IdentityUserUpdateDto, IdentityUserUpdatePasswordInput, IdentityUserUpdateRolesDto, ImportExternalUserInput, ImportUsersFromFileInputWithStream, ImportUsersFromFileOutput, OrganizationUnitDto, OrganizationUnitLookupDto, OrganizationUnitWithDetailsDto } from '../../../volo/abp/identity/models';



Error: src/app/proxy/dci/enrollment/users/custom-identity-user.service.ts:4:197 - error TS2305: Module '"../../../volo/abp/identity/models"' has no exported member 'IdentityRoleDto'.

4 import type { ClaimTypeDto, DownloadTokenResultDto, ExternalLoginProviderDto, GetIdentityUserListAsFileInput, GetIdentityUsersInput, GetImportInvalidUsersFileInput, GetImportUsersSampleFileInput, IdentityRoleDto, IdentityRoleLookupDto, IdentityUserClaimDto, IdentityUserCreateDto, IdentityUserDto, IdentityUserUpdateDto, IdentityUserUpdatePasswordInput, IdentityUserUpdateRolesDto, ImportExternalUserInput, ImportUsersFromFileInputWithStream, ImportUsersFromFileOutput, OrganizationUnitDto, OrganizationUnitLookupDto, OrganizationUnitWithDetailsDto } from '../../../volo/abp/identity/models';



Error: src/app/proxy/dci/enrollment/users/custom-identity-user.service.ts:4:282 - error TS2724: '"../../../volo/abp/identity/models"' has no exported member named 'IdentityUserDto'. Did you mean 'IdentityUserClaimDto'?

4 import type { ClaimTypeDto, DownloadTokenResultDto, ExternalLoginProviderDto, GetIdentityUserListAsFileInput, GetIdentityUsersInput, GetImportInvalidUsersFileInput, GetImportUsersSampleFileInput, IdentityRoleDto, IdentityRoleLookupDto, IdentityUserClaimDto, IdentityUserCreateDto, IdentityUserDto, IdentityUserUpdateDto, IdentityUserUpdatePasswordInput, IdentityUserUpdateRolesDto, ImportExternalUserInput, ImportUsersFromFileInputWithStream, ImportUsersFromFileOutput, OrganizationUnitDto, OrganizationUnitLookupDto, OrganizationUnitWithDetailsDto } from '../../../volo/abp/identity/models';



Error: src/app/proxy/dci/message-center/messages/models.ts:4:15 - error TS2440: Import declaration conflicts with local declaration of 'MessageDto'.

4 import type { MessageDto } from './models';



Error: src/app/proxy/volo/abp/identity/models.ts:142:10 - error TS2304: Cannot find name 'IdentityRoleDto'.

142 roles: IdentityRoleDto[];





× Failed to compile.


9 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    you can try to remove yarn.lock and restore packages again

    then re-generate proxies

  • User Avatar
    0
    dmannion created

    I deleted the yarn.lock file, ran yarn install and re-generated the proxies, but still get the same exact errors.

    Part of the errors are related to IdentityRoleDto and IdentityUserDto. The generated proxies try to import them from '../../../volo/abp/identity/models', but they don't exist there.

    I don't know why the generated proxy has this:

    import type { SaasTenantActivationState } from '../../../volo/saas/tenant-activation-state.enum'; It should be import type { TenantActivationState } from '../../../volo/saas/tenant-activation-state.enum';

    But even when I fix all of these issues, I'm still left with these three errors below. I've even tried clearing the angular cache.

    ./node_modules/@volo/abp.ng.account/fesm2022/volo-abp.ng.account-public.mjs:5002:26-31 - Error: export 'model' (imported as 'model') was not found in '@angular/core' ...

    ./node_modules/@volo/abp.ng.identity/fesm2022/volo-abp.ng.identity.mjs:3765:26-31 - Error: export 'model' (imported as 'model') was not found in '@angular/core' ...

    ./node_modules/@volo/abp.ng.identity/fesm2022/volo-abp.ng.identity.mjs:3828:26-31 - Error: export 'model' (imported as 'model') was not found in '@angular/core' ...

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    HI,

    Yes, this is a problem. see https://github.com/abpframework/abp/issues/20680

    you can downgrade the ng.schematics package to 7.4.x as a temporary solution

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    i refunded your ticket

  • User Avatar
    0
    dmannion created

    Downgrading the @abp/ng.schematics solves the proxy generation errors but running yarn start still fails to compile because of these errors:

    ./node_modules/@volo/abp.ng.account/fesm2022/volo-abp.ng.account-public.mjs:5002:26-31 - Error: export 'model' (imported as 'model') was not found in '@angular/core' ...

    ./node_modules/@volo/abp.ng.identity/fesm2022/volo-abp.ng.identity.mjs:3765:26-31 - Error: export 'model' (imported as 'model') was not found in '@angular/core' ...

    ./node_modules/@volo/abp.ng.identity/fesm2022/volo-abp.ng.identity.mjs:3828:26-31 - Error: export 'model' (imported as 'model') was not found in '@angular/core' ...

    I've tried clearing the node_modules folder, deleting the yarn.lock again and doing yarn install again. I don't understand these errors or how to debug them. Is there a minimum Angular or Node version we need to upgrade to along with the 8.2.2 upgrade? Is there any additional information I can provide you?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    I've tried clearing the node_modules folder, deleting the yarn.lock again and doing yarn install again. I don't understand these errors or how to debug them. Is there a minimum Angular or Node version we need to upgrade to along with the 8.2.2 upgrade? Is there any additional information I can provide you?

    you can try create a new project to compare

  • User Avatar
    0
    dmannion created

    I created a new project and it compiled successfully. After comparing the package.json files I noticed 8.2 is using angular 17.3.0, while I was still on 17.1.1. After manually updating Node.js to v20.12.2 and Angular core to V17.3.0, it now compiles correctly.

    Are minimum node and angular versions listed some where in the release notes? If not, that sure would have saved me a ton of time.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    okay, we will

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    https://github.com/abpframework/abp/pull/20727

Made with ❤️ on ABP v9.1.0-preview. Updated on November 01, 2024, 05:35