angularagm

Error while building Angular app with agm-spiderfier


  1. I a getting error while compiling my code with AGM Spidefier library \node_modules\agm-spiderfier\index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.

  2. Below are my tsconfig.app.json and tsconfig.spec.json

tsconfig.app.json

      {
         "extends": "./tsconfig.base.json",
         "compilerOptions": {
          "outDir": "./out-tsc/app",
           "types": []
        },
      "files": [
        "src/main.ts",
        "src/polyfills.ts"
      ],
      "include": [
        "src/**/*.d.ts",
        "../node_modules/agm-spiderfier/*.ts"
      ]
    }

tsconfig.spec.json

    {
      "extends": "./tsconfig.base.json",
      "compilerOptions": {
        "outDir": "./out-tsc/spec",
        "types": [
          "jasmine",
          "googlemaps"  
        ]
      },
      "files": [
        "src/test.ts",
        "src/polyfills.ts",
        "../node_modules/agm-spiderfier/index.ts",    
      ],
      "include": [
        "src/**/*.spec.ts",
        "src/**/*.d.ts",
        "../node_modules/agm-spiderfier/*.ts"
      ]
    }

Solution

  •     Please modify your both the files as below.
        
        tsconfig.app.json
        
        "include": [
            "src/**/*.d.ts",
            "node_modules/agm-spiderfier/**/*.ts"
          ]
        
    
    tsconfig.spec.json
        
         "include": [
            "src/**/*.spec.ts",
            "src/**/*.d.ts",
            "node_modules/agm-spiderfier/**/*.ts"
          ]