Open Closed

Issue after generating proxy - Circular definition of import alias 'TKey' #7211


User avatar
0
mateusz.krauze created
  • ABP Framework version: v8.1.1
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:

Error: src/app/proxy/models.ts:2:15 - error TS2303: Circular definition of import alias 'TKey'.

2 import type { TKey } from './models'; ~~~~

Error: src/app/proxy/models.ts:2:15 - error TS2459: Module '"./models"' declares 'TKey' locally, but it is not exported.

2 import type { TKey } from './models'; ~~~~

src/app/proxy/models.ts:2:15 2 import type { TKey } from './models'; ~~~~ 'TKey' is declared here.

  • Steps to reproduce the issue:

Just generate proxy using command: abp generate-proxy. After proxy is generated, error above appears. Removing this line: import type { TKey } from './models'; helps, but it's annoing to do it after each proxy generation.


5 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello,

    Please check the similar issue https://support.abp.io/QA/Questions/6657/Generation-of-Service-Proxies-for-Angular-not-handling-subclasses-of-PagedResultDtoT-correctly#answer-3a10d21f-9a90-0a22-9316-f313aa69f8a5

    Thanks.

  • User Avatar
    0
    mateusz.krauze created

    I saw this issue already, but i didn't found working solution there. The problem appears after upgrade to v8.1.1 (from v7.2.2) and no changes were made in backend.

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello,

    Please shared your package.json file & also check logs.

    Thanks

  • User Avatar
    0
    mateusz.krauze created

    Logs are clean, no errors and warnings during proxy generation. Here is my package.json:

    {
      "name": "MyProject",
      "version": "0.2.0",
      "scripts": {
        "ng": "ng",
        "start": "ng lint --fix && ng serve --configuration local --open",
        "proxy": "abp generate-proxy -t ng --module app",
        "build:dev": "ng lint --fix && ng build --configuration dev",
        "watch": "ng build --watch --configuration development",
        "test": "ng test",
        "lint": "ng lint"
      },
      "private": true,
      "dependencies": {
        "@abp/ng.components": "~8.1.1",
        "@abp/ng.core": "~8.1.1",
        "@abp/ng.oauth": "~8.1.1",
        "@abp/ng.setting-management": "~8.1.1",
        "@abp/ng.theme.shared": "~8.1.1",
        "@abp/ng.account": "~8.1.1",
        "@abp/ng.identity": "~8.1.1",
        "@volo/abp.commercial.ng.ui": "~8.1.1",
        "@volo/abp.ng.account": "~8.1.1",
        "@volo/abp.ng.audit-logging": "~8.1.1",
        "@volo/abp.ng.gdpr": "~8.1.1",
        "@volo/abp.ng.identity": "~8.1.1",
        "@volo/abp.ng.openiddictpro": "~8.1.1",
        "@volo/abp.ng.language-management": "~8.1.1",
        "@volo/abp.ng.saas": "~8.1.1",
        "@volo/abp.ng.text-template-management": "~8.1.1",
        "@volosoft/abp.ng.theme.lepton-x": "~3.1.1",
        "@angular/animations": "^17.3.5",
        "@angular/cdk": "17.3.5",
        "@angular/common": "^17.3.5",
        "@angular/compiler": "^17.3.5",
        "@angular/core": "^17.3.5",
        "@angular/forms": "^17.3.5",
        "@angular/localize": "^17.3.5",
        "@angular/platform-browser-dynamic": "^17.3.5",
        "@angular/platform-browser": "^17.3.5",
        "@angular/router": "^17.3.5",
        "@fullcalendar/angular": "6.1.10",
        "@fullcalendar/core": "6.1.10",
        "@fullcalendar/daygrid": "6.1.10",
        "@fullcalendar/interaction": "6.1.10",
        "@fullcalendar/timegrid": "6.1.10",
        "@microsoft/signalr": "8.0.0",
        "@ng-bootstrap/ng-bootstrap": "16.0.0",
        "@popperjs/core": "^2.11.8",
        "@typescript-eslint/utils": "7.7.0",
        "file-saver": "^2.0.5",
        "jquery": "^3.7.1",
        "jquery-ui-dist": "^1.13.2",
        "jspdf": "^2.5.1",
        "jspdf-autotable": "^3.5.29",
        "moment": "^2.29.4",
        "ngx-logger": "^5.0.11",
        "primeicons": "7.0.0",
        "primeng": "17.13.0",
        "xlsx": "^0.18.5",
        "rxjs": "~7.8.0",
        "tslib": "^2.0.0",
        "zone.js": "~0.14.0"
        },
      "devDependencies": {
        "@abp/ng.schematics": "~8.1.1",
        "@angular-devkit/build-angular": "~17.1.0",
        "@angular-eslint/builder": "~17.2.0",
        "@angular-eslint/eslint-plugin": "~17.2.0",
        "@angular-eslint/eslint-plugin-template": "~17.2.0",
        "@angular-eslint/schematics": "~17.2.0",
        "@angular-eslint/template-parser": "~17.2.0",
        "@angular/cli": "~17.1.0",
        "@angular/compiler-cli": "~17.1.0",
        "@angular/language-service": "~17.1.0",
        "@types/jasmine": "~3.6.0",
        "@types/node": "^20.0.0",
        "@typescript-eslint/eslint-plugin": "6.9.1",
        "@typescript-eslint/parser": "6.9.1",
        "eslint": "^8.0.0",
        "jasmine-core": "~4.0.0",
        "karma": "~6.3.0",
        "karma-chrome-launcher": "~3.1.0",
        "karma-coverage": "~2.1.0",
        "karma-jasmine": "~4.0.0",
        "karma-jasmine-html-reporter": "^1.7.0",
        "ng-packagr": "^17.3.0",
        "typescript": "~5.3.0"
      }
    }
    
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello,

    Please make sure you have followed migration guide while updating the application https://docs.abp.io/en/abp/latest/Migration-Guides/Index

    thanks

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