nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.28k stars 2.32k forks source link

Project not builds after update 10.4.4 to 11.0.4 #4297

Closed otecMuxah closed 3 years ago

otecMuxah commented 3 years ago

Current Behavior

Project not builds with error below.

Expected Behavior

Project builds correctly

Steps to Reproduce

Added nx 10.4.4 via ng add to existing Angular 10 project , then migrate to nx v.11

Failure Logs

> nx run lms:build 
✔ Browser application bundle generation complete.

Error: node_modules/@nrwl/tao/src/shared/params.d.ts:1:28 - error TS7016: Could not find a declaration file for module 'minimist'. '/Users/mikhailmalyavin/GitHub/CFI/localenv/projects/cfi-lms/node_modules/minimist/index.js' implicitly has an 'any' type.
  Try `npm install @types/minimist` if it exists or add a new declaration (.d.ts) file containing `declare module 'minimist';`

1 import { ParsedArgs } from 'minimist';
                             ~~~~~~~~~~
node_modules/@nrwl/tao/src/shared/params.d.ts:36:5 - error TS2411: Property ''--'' of type 'Unmatched[] | undefined' is not assignable to string index type 'string | number | boolean | string[] | Unmatched[]'.

36     '--'?: Unmatched[];
       ~~~~
node_modules/@nrwl/workspace/src/schematics/remove/schema.d.ts:1:33 - error TS2503: Cannot find namespace 'json'.

1 export interface Schema extends json.JsonObject {
                                  ~~~~

installing types for minimist solves first error , but second still remains

Environment

  OS   : darwin x64
  yarn : 1.22.4

  nx : Not Found
  @nrwl/angular : 11.0.4
  @nrwl/cli : 11.0.4
  @nrwl/cypress : 11.0.4
  @nrwl/devkit : 11.0.4
  @nrwl/eslint-plugin-nx : 11.0.4
  @nrwl/express : Not Found
  @nrwl/jest : 11.0.4
  @nrwl/linter : 11.0.4
  @nrwl/nest : Not Found
  @nrwl/next : Not Found
  @nrwl/node : Not Found
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 11.0.4
  @nrwl/web : Not Found
  @nrwl/workspace : 11.0.4
  typescript : 4.0.5

angular.json

      "projectType": "application",
      "schematics": {
        "@schematics/angular:component": {
          "style": "scss"
        }
      },
      "root": "apps/lms",
      "sourceRoot": "apps/lms/src",
      "prefix": "app",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist/apps/lms",
            "index": "apps/lms/src/index.html",
            "main": "apps/lms/src/main.ts",
            "polyfills": "apps/lms/src/polyfills.ts",
            "tsConfig": "apps/lms/tsconfig.app.json",
            "aot": true,
            "assets": ["apps/lms/src/favicon.ico", "apps/lms/src/assets"],
            "styles": ["apps/lms/src/assets/styles/styles.scss"],
            "scripts": ["node_modules/popper.js/dist/umd/popper.min.js"],
            "stylePreprocessorOptions": {
              "includePaths": ["libs/shared-ui/ui-styles/src/lib"]
            }
          },
          "configurations": {
            "lms-local": {
              "fileReplacements": [
                {
                  "replace": "apps/lms/src/environments/environment.ts",
                  "with": "apps/lms/src/environments/environment.lms.ts"
                }
              ]
            },
            "lms-staging": {
              "fileReplacements": [
                {
                  "replace": "apps/lms/src/environments/environment.ts",
                  "with": "apps/lms/src/environments/environment.lms.staging.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "namedChunks": false,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "2mb",
                  "maximumError": "5mb"
                },
                {
                  "type": "anyComponentStyle",
                  "maximumWarning": "20kb",
                  "maximumError": "50kb"
                }
              ]
            },
            "lms-e2e": {
              "fileReplacements": [
                {
                  "replace": "apps/lms/src/environments/environment.ts",
                  "with": "apps/lms/src/environments/environment.lms.e2e.ts"
                },
                {
                  "replace": "libs/shared-ui/auth/src/lib/environment.ts",
                  "with": "libs/shared-ui/auth/src/lib/environment.e2e.ts"
                }
              ]
            },
            "lms-e2e-ci": {
              "fileReplacements": [
                {
                  "replace": "apps/lms/src/environments/environment.ts",
                  "with": "apps/lms/src/environments/environment.lms.e2e.ts"
                },
                {
                  "replace": "libs/shared-ui/auth/src/lib/environment.ts",
                  "with": "libs/shared-ui/auth/src/lib/environment.e2e.ts"
                }
              ]
            },
            "lms-beta": {
              "fileReplacements": [
                {
                  "replace": "apps/lms/src/environments/environment.ts",
                  "with": "apps/lms/src/environments/environment.lms.beta.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "namedChunks": false,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "2mb",
                  "maximumError": "5mb"
                },
                {
                  "type": "anyComponentStyle",
                  "maximumWarning": "20kb",
                  "maximumError": "50kb"
                }
              ]
            }
          },
          "outputs": ["{options.outputPath}"]
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "lms:build"
          },
          "configurations": {
            "lms-local": {
              "browserTarget": "lms:build:lms-local"
            },
            "lms-e2e": {
              "browserTarget": "lms:build:lms-e2e"
            },
            "lms-e2e-ci": {
              "browserTarget": "lms:build:lms-e2e-ci"
            },
            "dashboard-local": {
              "browserTarget": "lms:build:dashboard-local"
            },
            "production": {
              "browserTarget": "lms:build:production"
            }
          }
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "lms:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "apps/lms/src/test.ts",
            "polyfills": "apps/lms/src/polyfills.ts",
            "tsConfig": "apps/lms/tsconfig.spec.json",
            "karmaConfig": "apps/lms/karma.conf.js",
            "assets": ["apps/lms/src/favicon.ico", "apps/lms/src/assets"],
            "styles": ["apps/lms/src/assets/styles/styles.scss"],
            "scripts": []
          },
          "outputs": ["coverage/apps/lms"]
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": ["apps/lms/tsconfig.app.json", "apps/lms/tsconfig.spec.json"],
            "exclude": ["**/node_modules/**"]
          }
        }
      }
    }

package.json

{
  "name": "lms",
  "version": "0.0.0",
  "scripts": {
    "ng": "nx",
    "start": "ng serve",
    "build": "ng build --optimization",
    "test": "ng test",
    "lint": "nx workspace-lint && ng lint",
    "e2e": "ng e2e",
    "nx": "nx",
    "affected:apps": "nx affected:apps",
    "affected:libs": "nx affected:libs",
    "affected:build": "nx affected:build",
    "affected:e2e": "nx affected:e2e",
    "affected:test": "nx affected:test",
    "affected:lint": "nx affected:lint",
    "affected:dep-graph": "nx affected:dep-graph",
    "affected": "nx affected",
    "format": "nx format:write",
    "format:write": "nx format:write",
    "format:check": "nx format:check",
    "update": "nx migrate latest",
    "update:check": "ng update",
    "dep-graph": "nx dep-graph",
    "help": "nx help",
    "postinstall": "node ./decorate-angular-cli.js && ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points",
    "workspace-generator": "nx workspace-generator"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "11.0.4",
    "@angular/cdk": "10.2.7",
    "@angular/common": "11.0.4",
    "@angular/compiler": "11.0.4",
    "@angular/core": "11.0.4",
    "@angular/forms": "11.0.4",
    "@angular/material": "10.2.7",
    "@angular/platform-browser": "11.0.4",
    "@angular/platform-browser-dynamic": "11.0.4",
    "@angular/router": "11.0.4",
    "@ng-select/ng-select": "5.0.8",
    "@techiediaries/ngx-qrcode": "9.1.0",
    "@types/object-path": "0.11.0",
    "@types/quill": "1.3.10",
    "beautify": "0.0.8",
    "lodash": "4.17.20",
    "ng-recaptcha": "6.0.2",
    "ngx-quill": "12.0.1",
    "popper.js": "1.16.0",
    "protractor-console-plugin": "^0.1.1",
    "quill": "2.0.0-dev.3",
    "rxjs": "6.5.5",
    "tslib": "2.0.0",
    "uuid": "8.3.1",
    "yurasm-quill-table-ui": "1.0.8",
    "zone.js": "0.10.3"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "0.1100.4",
    "@angular-eslint/eslint-plugin": "0.8.0-beta.1",
    "@angular-eslint/eslint-plugin-template": "0.8.0-beta.1",
    "@angular-eslint/template-parser": "0.8.0-beta.1",
    "@angular/cli": "11.0.4",
    "@angular/compiler-cli": "11.0.4",
    "@angular/language-service": "11.0.4",
    "@nrwl/angular": "11.0.4",
    "@nrwl/cypress": "11.0.4",
    "@nrwl/eslint-plugin-nx": "11.0.4",
    "@nrwl/jest": "11.0.4",
    "@nrwl/workspace": "11.0.4",
    "@types/jasmine": "3.6.2",
    "@types/jasminewd2": "2.0.3",
    "@types/jest": "26.0.8",
    "@types/lodash": "4.14.161",
    "@types/node": "12.12.38",
    "@types/uuid": "8.3.0",
    "@typescript-eslint/eslint-plugin": "4.3.0",
    "@typescript-eslint/parser": "4.3.0",
    "codelyzer": "6.0.1",
    "cypress": "5.5.0",
    "eslint": "7.10.0",
    "eslint-config-prettier": "6.0.0",
    "jasmine-core": "3.5.0",
    "jasmine-spec-reporter": "5.0.0",
    "jest": "26.2.2",
    "jest-preset-angular": "8.3.1",
    "karma": "5.0.0",
    "karma-chrome-launcher": "3.1.0",
    "karma-coverage-istanbul-reporter": "3.0.2",
    "karma-jasmine": "3.3.0",
    "karma-jasmine-html-reporter": "1.5.0",
    "prettier": "2.1.2",
    "protractor": "7.0.0",
    "protractor-beautiful-reporter": "^1.3.6",
    "rxjs-tslint-rules": "4.34.5",
    "ts-jest": "26.4.0",
    "ts-node": "9.0.0",
    "tslint": "6.1.0",
    "typescript": "4.0.5"
  }
}

tsconfig

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": ".",
    "outDir": "./dist/out-tsc",
    "target": "es2015",
    "module": "esnext",
    "allowSyntheticDefaultImports": true,
    "forceConsistentCasingInFileNames": true,
    "strict": true,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true,
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "moduleResolution": "node",
    "importHelpers": true,
    "typeRoots": ["node_modules/@types"],
    "types": ["node", "jest"],
    "lib": ["es2018", "dom"],
    "rootDir": ".",
    "paths": {
      "@cfi-core/*": ["apps/lms/src/app/core/*"],
      "@lms/admin-lms/models": ["libs/admin-lms/models/src/index.ts"],
      "@lms/shared/models": ["libs/shared/models/src/index.ts"],
      "@lms/shared-ui/ui-components": ["libs/shared-ui/ui-components/src/index.ts"],
      "@lms/shared-ui/file-upload": ["libs/shared-ui/file-upload/src/index.ts"],
      "@lms/shared/user-service": ["libs/shared/user-service/src/index.ts"],
      "@lms/shared/base-api": ["libs/shared/base-api/src/index.ts"],
      "@lms/shared-ui/base-theme": ["libs/shared-ui/base-theme/src/index.ts"],
      "@lms/shared-ui/notifier": ["libs/shared-ui/notifier/src/index.ts"],
      "@lms/shared-ui/sidebar": ["libs/shared-ui/sidebar/src/index.ts"],
      "@lms/shared-ui/top-menu": ["libs/shared-ui/top-menu/src/index.ts"],
      "@lms/shared-ui/auth": ["libs/shared-ui/auth/src/index.ts"],
      "@lms/shared-ui/error": ["libs/shared-ui/error/src/index.ts"],
      "@lms/shared-ui/ui-styles": ["libs/shared-ui/ui-styles/src/index.ts"],
      "@lms/dashboard-ui/home": ["libs/dashboard-ui/home/src/index.ts"],
      "@lms/dashboard-ui/courses": ["libs/dashboard-ui/courses/src/index.ts"],
      "@lms/dashboard-ui/user": ["libs/dashboard-ui/user/src/index.ts"],
      "@lms/shared/pipes": ["libs/shared/pipes/src/index.ts"],
      "@lms/shared/directives": ["libs/shared/directives/src/index.ts"],
      "@lms/shared/storages": ["libs/shared/storages/src/index.ts"],
      "@lms/shared/services/app-services": ["libs/shared/services/app-services/src/index.ts"],
      "@lms/shared/services/api-services": ["libs/shared/services/api-services/src/index.ts"],
      "@lms/shared/dirty-check-guard": ["libs/shared/dirty-check-guard/src/index.ts"],
      "@lms/shared-ui/paginator": ["libs/shared-ui/paginator/src/index.ts"],
      "@lms/admin-lms-ui/category-listing": ["libs/admin-lms-ui/category-listing/src/index.ts"],
      "@lms/admin-lms-ui/category-details": ["libs/admin-lms-ui/category-details/src/index.ts"]
    }
  },
  "angularCompilerOptions": {
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true,
    "strictTemplates": true,
    "strictInputAccessModifiers": true
  }
}
otecMuxah commented 3 years ago
Screenshot 2020-12-15 at 11 49 59

solved by removing types from tsconfig

github-actions[bot] commented 1 year ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.