question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

errors "is part of the Typescript compilation but its unused " "@angular-builders/custom-webpack": "11.1.1"

See original GitHub issue

image

I tried everything suggested here: https://stackoverflow.com/questions/57729518/how-to-get-rid-of-the-warning-ts-file-is-part-of-the-typescript-compilation-but

In my case a custom webpack could be the problem as mentioned in the above issue.

{
  "name": "m",
  "version": "1.0.0",
  "main": "src/main.ts",
  "eslintConfig": {
    "globals": {
      "Polymer": true,
      "module": true
    },
    "env": {
      "browser": true,
      "amd": true,
      "node": true
    }
  },
  "nodemonConfig": {
    "watch": [
      "src",
      "apps",
      "libs"
    ],
    "ext": "ts,js,html,scss",
    "ignore": [
      "dist/*.*",
      "marmind/dist/*.*"
    ]
  },
  "scripts": {...
  },
  "keywords": [],
  "private": true,
  "license": "UNLICENSED",
  "dependencies": {
    "@ag-grid-community/all-modules": "25.1.0",
    "@ag-grid-enterprise/all-modules": "25.1.0",
    "@angular/animations": "^11.0.0 || ^12.0.0-0",
    "@angular/cdk": "11.2.5",
    "@angular/forms": "^11.2.6",
    "@angular/material": "11.2.5",
    "@ng-select/ng-select": "6.1.0",
    "@types/video.js": "7.2.5",
    "ag-grid": "18.1.2",
    "angular": "1.6.8",
    "angular-animate": "1.6.8",
    "angular-bindonce": "0.3.1",
    "angular-carousel": "1.1.0",
    "angular-cookies": "1.6.8",
    "angular-drag-and-drop-lists": "2.1.0",
    "angular-dynamic-locale": "0.1.32",
    "angular-elastic": "2.5.1",
    "angular-i18n": "1.6.8",
    "angular-jquery-timepicker": "0.13.1",
    "angular-loading-bar": "0.9.0",
    "angular-resource": "1.6.8",
    "angular-sanitize": "1.6.8",
    "angular-spectrum-colorpicker": "1.4.5",
    "angular-touch": "1.7.8",
    "angular-translate": "2.17.0",
    "angular-ui-bootstrap": "2.5.6",
    "angular-ui-grid": "4.1.3",
    "angular-ui-mention": "0.0.8",
    "angular-ui-router": "0.4.3",
    "angular-ui-select2": "https://github.com/m/ui-select2.git#v0.0.5.2",
    "angular-ui-validate": "1.2.3",
    "angular-xeditable": "0.8.1",
    "angular2-text-mask": "9.0.0",
    "angulartics": "1.3.0",
    "angulartics-piwik": "https://github.com/m/angulartics-piwik.git#master",
    "core-js": "3.6.5",
    "cropper": "3.1.3",
    "cssnano": "4.1.10",
    "d3": "5.7.0",
    "fs-extra": "5.0.0",
    "fullcalendar": "3.9.0",
    "grunt-contrib-watch": "1.1.0",
    "grunt-exec": "3.0.0",
    "grunt-po2json-angular-translate": "https://github.com/marmind/grunt-po2json-angular-translate.git#master",
    "inputmask": "5.0.3",
    "jodit": "git+https://github.com/marmind/jodit.git",
    "jquery": "3.4.1",
    "jquery-backstretch": "2.1.16",
    "jquery-migrate": "3.3.2",
    "jquery-ui": "1.12.1",
    "jquery.fancytree": "github:marmind/fancytree#addfad81f1fde0dc73f3bdb1895bd5cebbe40e6c",
    "jsplumb": "2.6.9",
    "jsrender": "0.9.90",
    "juxtaposejs": "1.1.6",
    "load-grunt-tasks": "3.5.2",
    "moment": "2.27.0",
    "moment-timezone": "0.5.31",
    "ng-file-upload": "12.2.13",
    "ng-fittext": "4.2.3",
    "ng-juxtapose": "1.0.2",
    "ng-metadata": "4.0.1",
    "ng-quill": "4.5.1",
    "pdfjs-dist": "2.5.147",
    "pixi.js": "4.7.3",
    "quill": "1.3.7",
    "quill-emoji": "0.1.7",
    "rxjs": "~6.5.5",
    "signalr": "2.4.1",
    "sortablejs": "1.10.2",
    "spectrum-colorpicker": "1.8.0",
    "terser-webpack-plugin": "5.1.1",
    "timepicker": "1.11.12",
    "tslib": "^2.0.0",
    "ui-cropper": "1.0.6",
    "ui-select": "https://github.com/m/ui-select.git#v0.16.1.1",
    "underscore": "1.8.3",
    "video.js": "7.2.3",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-builders/custom-webpack": "11.1.1",
    "@angular-devkit/build-angular": "0.1102.5",
    "@angular-devkit/core": "11.2.5",
    "@angular/cli": "11.2.5",
    "@angular/common": "11.2.6",
    "@angular/compiler": "11.2.6",
    "@angular/compiler-cli": "11.2.6",
    "@angular/core": "11.2.6",
    "@angular/platform-browser": "11.2.6",
    "@angular/platform-browser-dynamic": "11.2.6",
    "@angular/upgrade": "11.2.6",
    "@babel/core": "^7.7.7",
    "@babel/plugin-proposal-nullish-coalescing-operator": "7.10.4",
    "@babel/plugin-proposal-optional-chaining": "7.11.0",
    "@babel/preset-env": "^7.7.7",
    "@compodoc/compodoc": "1.1.11",
    "@pixi/core": "6.0.0",
    "@pixi/filter-drop-shadow": "4.0.0",
    "@pixi/filter-glow": "4.0.0",
    "@pixi/math": "6.0.0",
    "@pixi/settings": "6.0.0",
    "@pixi/utils": "6.0.0",
    "@storybook/addon-actions": "6.2.0-rc.2",
    "@storybook/addon-essentials": "6.2.0-rc.2",
    "@storybook/addon-links": "6.2.0-rc.2",
    "@storybook/angular": "6.2.0-rc.2",
    "@types/angular": "1.6.57",
    "@types/angular-dynamic-locale": "0.1.35",
    "@types/angular-resource": "1.5.15",
    "@types/angular-translate": "2.16.2",
    "@types/angular-ui-bootstrap": "0.13.46",
    "@types/angular-ui-router": "1.1.40",
    "@types/core-js": "0.9.46",
    "@types/d3": "5.7.2",
    "@types/jquery": "3.3.31",
    "@types/jqueryui": "1.12.15",
    "@types/jsrender": "0.0.29",
    "@types/lodash": "4.14.105",
    "@types/pixi.js": "4.7.3",
    "@types/underscore": "1.8.6",
    "@typescript-eslint/parser": "^4.1.0",
    "angular-mocks": "1.6.4",
    "autoprefixer": "9.7.6",
    "babel-loader": "8.1.0",
    "bootstrap": "3.3.7",
    "concurrently": "6.0.0",
    "copy-webpack-plugin": "6.1.1",
    "cross-env": "6.0.3",
    "cypress": "5.1.0",
    "file-loader": "5.0.2",
    "font-awesome": "4.7.0",
    "grunt": "1.0.4",
    "grunt-contrib-copy": "1.0.0",
    "imports-loader": "1.2.0",
    "jasmine-core": "~3.5.0",
    "jest": "26.6.3",
    "jest-preset-angular": "8.3.2",
    "karma": "~5.2.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.3",
    "karma-jasmine": "~4.0.1",
    "karma-jasmine-html-reporter": "1.5.4",
    "lodash": "4.17.15",
    "material-icons": "0.5.4",
    "mdi": "2.2.43",
    "ng-packagr": "11.2.4",
    "nodemon": "2.0.4",
    "postcss": "8.2.8",
    "protractor": "~7.0.0",
    "speed-measure-webpack-plugin": "1.3.1",
    "typescript": "4.1.5",
    "webpack": "4.46.0"
  },
  "engines": {
    "node": ">= 8.x",
    "npm": ">= 5"
  },
  "browser": {
    "http": false
  }
}
{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "m-enterprise": {
      "projectType": "application",
      "schematics": {
        "@schematics/angular:component": {
          "style": "less,sass"
        }
      },
      "root": "",
      "sourceRoot": "src",
      "prefix": "app",
      "architect": {
        "build": {
          "builder": "@angular-builders/custom-webpack:browser",
          "options": {
            "customWebpackConfig": {
              "path": "./webpack-m.config.js"
            },
            "allowedCommonJsDependencies": ["rxjs", "rxjs-compat", "inputmask", "quill-emoji", "pixi.js"],
            "outputPath": "dist",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "deleteOutputPath": false,
            "outputHashing": "none",
            "tsConfig": "tsconfig.app.json",
            "namedChunks": false,
            "showCircularDependencies": false,
            "extractLicenses": false,
            "statsJson": false,
            "progress": true,
            "sourceMap": false,
            "buildOptimizer": false,
            "aot": true,
            "preserveSymlinks": false,
            "optimization": {
              "styles": false,
              "scrypts": false,
              "fonts": false
            },
            "vendorChunk": true,
            "commonChunk": true,
            "watch": false,
            "assets": ["src/favicon.ico", "src/assets"],
            "styles": [
              "src/styles.less",
              "node_modules/@ag-grid-community/all-modules/dist/styles/ag-grid.css",
              "node_modules/@ag-grid-community/all-modules/dist/styles/ag-theme-balham.css",
              "node_modules/@ag-grid-community/all-modules/dist/styles/ag-theme-alpine.css",
              "node_modules/@ng-select/ng-select/themes/material.theme.css",
              "node_modules/material-icons/iconfont/material-icons.css",
              "node_modules/font-awesome/scss/font-awesome.scss",
              "node_modules/typeface-nunito/index.css",
              "styles.scss",
              "m/m-app-theme.scss"
            ],
            "scripts": [
              "node_modules/jquery/dist/jquery.min.js",
              "node_modules/underscore/underscore-min.js",
              "libs-manual/modernizr/modernizr.js",
              "node_modules/moment/moment.js",
              "node_modules/angular/angular.js",
              "node_modules/angular-resource/angular-resource.js",
              "node_modules/angular-bindonce/bindonce.js",
              "node_modules/pixi.js/dist/pixi.js",
              "node_modules/signalr/jquery.signalR.js"
            ]
          },
          "configurations": {...
        },
        "serve": {
          "builder": "@angular-builders/custom-webpack:dev-server",
          "options": {
            "browserTarget": "m-enterprise:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "m-enterprise:build:production"
            }
          }
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "m-enterprise:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "m/test.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.spec.json",
            "karmaConfig": "karma.conf.js",
            "assets": ["src/img"],
            "styles": ["src/styles.less"],
            "scripts": []
          }
        },
        "e2e": {
          "builder": "@angular-devkit/build-angular:protractor",
          "options": {
            "protractorConfig": "e2e/protractor.conf.js",
            "devServerTarget": "m-enterprise:serve"
          },
          "configurations": {
            "production": {
              "devServerTarget": "m-enterprise:serve:production"
            }
          }
        }
      }
    }
  },
  "defaultProject": "m-enterprise"
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jneuhaus20commented, Jun 28, 2021

I resolved my vaguely, potentially related issue. It turns out this was a global variable being set (so not declared anywhere.) Angular has you change the target in tsconfig from es5 to es2015 as part of the upgrade, and I guess that added some wrapping or context around the library import that made it no longer like that. Changing it back to es5 took care of it.

0reactions
arturovtcommented, Dec 22, 2022

Closing as stale.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get rid of the warning .ts file is part of the TypeScript ...
module.ts is part of the TypeScript compilation but it's unused. Add only entry points to the 'files' or 'include' properties in your tsconfig....
Read more >
How to get rid the WARNING: xxx.ts is part of the TypeScript ...
WARNING in xxx.ts is part of the TypeScript compilation but it's unused. Add only entry points to the 'files' or 'include' properties in ......
Read more >
angular-builders - Bountysource
errors "is part of the Typescript compilation but its unused " "@angular-builders/custom-webpack": "11.1.1" $ 0.
Read more >
How to get rid of the warning .ts file is part of the TypeScript ...
js". So, this line was causing the error "WARNING in src\app\user.service.ts is part of the TypeScript compilation but it's unused ...
Read more >
angular/angular - Gitter
... is part of the TypeScript compilation but it's unused. Add only entry points to the 'files' or 'include' properties in your tsconfig....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found