What can we do to prevent this from happening again? Our local dev envs and our automated builds cannot be dependent on your services being up and working. Can we configure a local nuget repository as a fallback or something? Can you provide instructions on what we'd need to change?
When building locally, we are now being prompted with this dialog:
Our build process fails with this: Unhandled exception: NuGet.Protocol.Core.Types.FatalProtocolException: Unable to load the service index for source https://nuget.abp.io/2a117af7-281a-43fc-b1f9-97595ce61632/v3/index.json. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 403 (Forbidden).
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.
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?
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' ...
./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.
I did see that, but not sure where to to hook that in on the Angular side. Can you point me to where I can add this?
It seems to me that the correct fix would be to update the navigateToLogin method in the oath.service.ts to something like this:
` navigateToLogin(queryParams?: Params) {
//Add the tenantId to the query string parameters so the login page has a chance to set the current tenant by default
const tenant = this.sessionStateService.getTenant();
if(tenant?.id)
queryParams = {...{ [this.tenantKey]: tenant.id }, ...queryParams};
this.strategy.navigateToLogin(queryParams);
}`
If a user accesses a hyperlink like: http://localhost:4200/?__tenant=5a896a41-adb2-872d-7330-3a141289a314
The Angular UI will correctly recognize the Tenant Id, look up the tenant and set the Tenant cookie and http header. However, if the user is not yet logged in, when it redirects to the Auth Server, it does not pass the tenant Id in the http header or query string. The user is then required to select the tenant, even though the Angular UI already knows what tenant the user is trying to access.
This creates a problem when a separate application is redirecting a user into our ABP application. We already know the tenantId and can pass it via the query string, so the user should not have to know the name of the Tenant or select it when logging in.
The AuthServer already supports Tenant resolution via the various methods, so if I manually add the __tenant query string parameter like so: https://localhost:44372/Account/Login?__tenant=5a896a41-adb2-872d-7330-3a141289a314&ReturnUrl=%2Fconnect%2Fauthorize%3Fresponse_type%3Dcode%26client_id%3DSample_App%26state%3DQl9hQWsyZEpzSnBmUkMyejMuaDlILTZLemFUeERDNVBKaVdYaGVmT3ItX3pL%26redirect_uri%3Dhttp%253A%252F%252Flocalhost%253A4200%26scope%3Dopenid%2520offline_access%2520Sample%26code_challenge%3DG84U3eHCgDgoJP3vtsZuYV6gHdKUoAEh3Bgxt_oKz7Q%26code_challenge_method%3DS256%26nonce%3DQl9hQWsyZEpzSnBmUkMyejMuaDlILTZLemFUeERDNVBKaVdYaGVmT3ItX3pL%26culture%3Den%26ui-culture%3Den
The AuthServer will correctly select the Tenant. Is there a way to make the Angular UI send the tenant header or query string parameter?
In our Application.Contracts, we have the following class: public class MyEntityCustomPagedResultDto : PagedResultDto<MyEntityDto>
After running abp generate-proxy -t ng, the angular app fails to compile with this error: error TS2440: Import declaration conflicts with local declaration of 'MyEntityDto'
The resulting models.ts file includes both an import for MyEntityDto and and interface definition for MyEntityDto: import type { MyEntityDto } from './models';
Also, a slightly different error results if the custom class is instead defined like this: public class MyEntityCustomPagedResultDto<T> : PagedResultDto<T>
After running abp generate-proxy -t ng, the angular app fails to compile with this error: error TS2305: Module '"../../../models"' has no exported member 'T'.
The resulting models.ts file includes the following import: import type { T } from '../../../models';