Angular compilation initialization failed Cannot resolve type entity i1.FocusTrapModule to...

Discussão em 'Angular' iniciado por Santa Paws, Março 7, 2025.

  1. Santa Paws

    Santa Paws Guest

    When I try ng build, I get the following error:

    X [ERROR] Angular compilation initialization failed. [plugin angular-compiler]

    Error: Cannot resolve type entity i1.FocusTrapModule to symbol at reflectTypeEntityToDeclaration (file:///C:/AQMD/Projects/.NET%20Core/Rule1180%20Dashboard/Rule1180Dashboard/node_modules/@angular/compiler-cli/bundles/chunk-PGXXZYOH.js:745:11)

    and other stack info

    I did not reference or try import FocusTrapModule anywhere in my project. Here is part of my package-lock.json

    "dependencies": {
    "@angular/animations": "^18.2.0",
    "@angular/cdk": "^18.2.14",
    "@angular/common": "^18.2.0",
    "@angular/compiler": "^18.2.13",
    "@angular/core": "^18.2.0",
    "@angular/forms": "^18.2.0",
    "@angular/material": "^18.2.14",
    "@angular/platform-browser": "^18.2.0",
    "@angular/platform-browser-dynamic": "^18.2.0",
    "@angular/platform-server": "^18.2.0",
    "@angular/router": "^18.2.0",
    "@angular/ssr": "^18.2.2",
    "@auth0/angular-jwt": "^5.2.0",
    "express": "^4.18.2",
    "jquery": "^3.7.1",
    "moment": "^2.30.1",
    "ngx-bootstrap": "^18.1.3",
    "ngx-spinner": "^17.0.0",
    "ngx-toastr": "^18.0.0",
    "rxjs": "~7.8.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.14.10"
    },
    "devDependencies": {
    "@angular-devkit/build-angular": "^18.2.14",
    "@angular/cdk": "^18.2.14",
    "@angular/cli": "^18.2.14",
    "@angular/compiler-cli": "^18.2.13",
    "@types/express": "^4.17.17",
    "@types/jasmine": "~5.1.0",
    "@types/node": "^18.18.0",
    "jasmine-core": "~5.2.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.2.0",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.1.0",
    "typescript": "~5.5.2"
    }


    I tried remove boostrap, deleted node_modules and run npm install to rebuild node_modules, but nothing works.

    I do have ngx-modal popup referenced in my project, and I find that in node_modules\ngx-bootstrap\modal\modal.module.d.ts, the focus-trap is imported as

    import * as i1 from "ngx-bootstrap/focus-trap";


    It seems where the Angular compiler got confused, but I have no idea how to fix this issue.

    Any help is appreciated

    Continue reading...

Compartilhe esta Página