Open Closed

Angular NG3004 issue with abpSuite Code generator #10448


User avatar
0
Maniev created

Angular NG3004 issue with abpSuite Code generator. In a modular application when you generate UI components in the module itself.

  • Template: app
  • Created ABP Studio Version: 2.1.6
  • Current ABP Studio Version: 2.1.9
  • Tiered: No
  • Multi-Tenancy: Yes
  • UI Framework: angular
  • Theme: leptonx
  • Theme Style: dim
  • Theme Menu Placement: side
  • Progressive Web App: No
  • Run Progressive Web App Support: No
  • Database Provider: ef
  • Database Management System: sqlserver
  • Separate Tenant Schema: Yes
  • Mobile Framework: none
  • Public Website: Yes
  • Social Login: Yes
  • Include Tests: Yes
  • Kubernetes Configuration: No
  • Distributed Event Bus: none
  • Use Local References: No
  • Optional Modules:
    • GDPR
    • TextTemplateManagement
    • AuditLogging
    • OpenIddictAdmin
  • Selected Languages: English
  • Default Language: English
  • Create Command: abp new iOCO.XeoN.Core -t app --ui-framework angular --database-provider ef --database-management-system sqlserver --theme leptonx --separate-tenant-schema --skip-migration --skip-migrator --public-website --without-cms-kit --dont-run-install-libs --dont-run-bundling -no-file-management -no-language-management
  • Exception message and full stack trace:

[ERROR] NG3004: Unable to import symbol PermissionDirective. The symbol is not exported from <filepath>/angular/node_modules/@abp/ng.core/index.d.ts (module '@abp/ng.core'). [plugin angular-compiler]

src/app/dashboard/dashboard.component.ngtypecheck.ts:0:0: 0 ¦ ? ^

The symbol is declared here.

node_modules/@abp/ng.core/index.d.ts:2486:0: 2486 ¦ declare class PermissionDirective implements OnDestroy, OnChange... ? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .... .... ....

  • Steps to reproduce the issue:
  • Create a modular angular application. Test that everything works.
  • Add a New Entity using abp Suite to the module. The angular component gets created along with the proxy. yarn start will then throw numerous errors: All of them are similar to the below (I have replaced teh actual path with <filepath>:

We have also attempted to re-create the issue and get a similar issue with 'PageComponent' this time referencing the module itself. If we remove the file reference in tsconfig, build the module, then add a yarn reference with a file link and build the main application (i.e. bypass the "paths": {}) , the code itself works. This indicates a potential issue with the setup of the angular modules in ABP 10 or with abp Suite code generator.


2 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • This is not an ABP Suite “wrong import” problem; it’s a TypeScript paths + Angular new application builder resolution problem that shows up only in modular/module-development scenario (where you reference module UI libs via tsconfig.paths to their projects/.../src/public-api.ts), and it can manifest as:

      • NG3004: Unable to import symbol PermissionDirective. The symbol is not exported from ... @abp/ng.core/index.d.ts
      • similar errors for other symbols (e.g., PageComponent, etc.)
    • Why it happens

      • With the newer Angular build system, mapping packages to node_modules (directly or indirectly) is stricter and local library builds can end up being resolved in a way that mixes two “copies” of ABP Angular packages (one from the main app’s node_modules, another from the module library build context).
      • When the Angular compiler/type-checker ends up analyzing .d.ts from one place but expects exports consistent with another resolution graph, you get “symbol declared here but not exported from index.d.ts” style errors (like your PermissionDirective case).
    • Definitive workaround (recommended by ABP community guidance): use symlinks instead of relying on paths to source projects

      1. Remove any tsconfig.json / tsconfig.base.json path mappings that try to “redirect” packages to node_modules (or that cause the library project to resolve ABP dependencies differently than the app).
      2. Keep your module UI packages referenced as local projects (as needed), but ensure the library projects resolve dependencies from the same node_modules as the main Angular app by symlinking dependencies into each library project.
      3. In practice, the approach is:
        • create a node_modules folder under each angular/projects/<your-module-lib> if it doesn’t exist
        • symlink required packages (at least @abp/*, @angular/*, rxjs, etc.) from the main app angular/node_modules into the library’s node_modules
        • then build/run as usual

      This matches the behavior you observed: when you bypass paths and consume the built output via file: dependency, everything works because module resolution becomes consistent again.

    • What to do in ABP v10.x

      • Until the template/codegen is adjusted for this scenario, the stable approach is:
        • either use the symlink strategy for “module development UI inside same workspace”
        • or build the module and consume it via file: (your current working approach), avoiding paths redirection.

    Sources (validated)

    • https://abp.io/community/articles/5z2ate6e

    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
    sumeyye.kurtulus created
    Support Team Angular Expert

    Thank you for the detailed explanation of the issue. I was not able to reproduce the problem on my end.

    Could you please confirm which Suite version you used for the generation? You can find the version details in the documentation: https://abp.io/docs/latest/studio/working-with-suite

    Additionally, it would be very helpful if you could share the dependency information from your package.json file.

    Thank you in advance 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.2.0-preview. Updated on February 17, 2026, 09:10
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.