just-jeb / angular-builders

Angular build facade extensions (Jest and custom webpack configuration)
MIT License
1.14k stars 198 forks source link

Getting `objValue.concat is not a function` with `ng test` #846

Closed dcp3450 closed 3 years ago

dcp3450 commented 4 years ago

Creating an Angular v9 project that uses jest. When I run ng test I get this error:

An unhandled exception occurred: objValue.concat is not a function
See "C:\Users\David\AppData\Local\Temp\ng-ku4Gnx\angular-errors.log" for further details

package.json:

{
  "name": "ui",
  "version": "1.31.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "ie11": "ng serve --configuration es5",
    "build": "ng build",
    "build:prod": "npm run build -- --prod --base-href=/ela/ --no-progress",
    "test": "ng test",
    "test:watch": "ng test --watch",
    "test:ci": "ng test --ci --coverage",
    "test:coverage": "ng test --coverage",
    "lint": "ng lint",
    "lint:staged": "eslint --fix",
    "lint:sass": "sass-lint -c ./.sass-lint.yml -v -q",
    "lint:sass:fix": "sass-lint-auto-fix",
    "e2e": "ng e2e",
    "cypress:open": "cypress open",
    "postinstall": "ngcc"
  },
  "lint-staged": {
    "src/**/*.ts": [
      "npm run lint:staged",
      "git add"
    ],
    "src/**/*.scss": [
      "npm run lint:sass:fix",
      "npm run lint:sass",
      "git add"
    ]
  },
  "husky": {
    "hooks": {
      "pre-commit": "pretty-quick --staged && lint-staged"
    }
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~9.1.12",
    "@angular/cdk": "^9.2.4",
    "@angular/common": "~9.1.12",
    "@angular/compiler": "~9.1.12",
    "@angular/flex-layout": "^9.0.0-beta.29",
    "@angular/forms": "~9.1.12",
    "@angular/material": "^9.2.4",
    "@angular/platform-browser": "~9.1.12",
    "@angular/platform-browser-dynamic": "~9.1.12",
    "@angular/router": "~9.1.12",
    "@material/theme": "^0.41.0",
    "@ngx-cache/core": "^8.0.1",
    "@ngx-cache/platform-browser": "^8.0.1",
    "@ngx-config/core": "^8.0.1",
    "@ngx-config/http-loader": "^8.0.2",
    "@types/deep-diff": "0.0.31",
    "@types/faker": "^4.1.2",
    "chart.js": "^2.7.2",
    "chartjs-plugin-annotation": "^0.5.7",
    "chartjs-top-round-bar": "^1.0.1",
    "classlist.js": "^1.1.20150312",
    "core-js": "^2.5.4",
    "custom-event-polyfill": "^1.0.7",
    "deep-diff": "^1.0.2",
    "enum-values": "^1.2.1",
    "file-saver": "^2.0.1",
    "filepond": "^4.3.5",
    "filepond-plugin-file-validate-type": "^1.2.4",
    "fsevents": "^2.1.3",
    "hammerjs": "^2.0.8",
    "keycloak-angular": "^7.1.0",
    "lodash": "^4.17.20",
    "mixin-deep": "^1.3.2",
    "ngx-device-detector": "^1.3.20",
    "ngx-filepond": "^5.0.0",
    "ngx-pagination": "^3.2.1",
    "rxjs": "~6.5.4",
    "set-value": "^2.0.1",
    "tslib": "^1.10.0",
    "uuid": "^3.3.3",
    "web-animations-js": "^2.3.2",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-builders/custom-webpack": "^8.4.1",
    "@angular-builders/jest": "^9.0.1",
    "@angular-devkit/build-angular": "~0.901.12",
    "@angular/cli": "~9.1.12",
    "@angular/compiler-cli": "~9.1.12",
    "@angular/language-service": "^8.2.14",
    "@types/jest": "^25.1.3",
    "@types/node": "^12.11.1",
    "@types/jasmine": "~3.5.0",
    "@types/jasminewd2": "~2.0.3",
    "codelyzer": "^5.1.2",
    "faker": "^4.1.0",
    "husky": "^2.7.0",
    "jest": "^26.0.0",
    "jest-junit": "^10.0.0",
    "jest-preset-angular": "^8.0.0",
    "keycloak-js": "^4.8.3",
    "lint-staged": "^9.4.2",
    "ng-bullet": "^1.0.3",
    "ng-mocks": "^8.1.0",
    "node-sass": "^4.14.1",
    "prettier": "1.19.1",
    "pretty-quick": "^2.0.1",
    "sass-lint": "^1.12.1",
    "sass-lint-auto-fix": "^0.21.0",
    "protractor": "~7.0.0",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "~3.8.3",
    "tslint-config-prettier": "^1.18.0",
    "tslint-jasmine-rules": "^1.6.1",
    "@angular-eslint/builder": "0.0.1-alpha.32",
    "@angular-eslint/eslint-plugin": "0.0.1-alpha.32",
    "@angular-eslint/eslint-plugin-template": "0.0.1-alpha.32",
    "@angular-eslint/schematics": "0.0.1-alpha.32",
    "@angular-eslint/template-parser": "0.0.1-alpha.32",
    "@typescript-eslint/eslint-plugin": "^3.3.0",
    "@typescript-eslint/eslint-plugin-tslint": "^3.3.0",
    "@typescript-eslint/parser": "^3.3.0",
    "eslint": "^6.8.0",
    "eslint-config-angular": "^0.5.0",
    "eslint-config-prettier": "^6.11.0",
    "eslint-plugin-angular": "^4.0.1",
    "eslint-plugin-html": "^6.0.2",
    "eslint-plugin-prettier": "^3.1.4"
  }
}

error log output:

[error] TypeError: objValue.concat is not a function
    at concatArrayProperties (D:\projects\...\project\project-upgrade\project-upgrade\node_modules\@angular-builders\jest\dist\jest-configuration-builder.js:22:21)
    at baseMergeDeep (D:\projects\...\project\project-upgrade\project-upgrade\node_modules\lodash\lodash.js:3643:11)
    at D:\projects\...\project\project-upgrade\project-upgrade\node_modules\lodash\lodash.js:3603:11
    at D:\projects\...\project\project-upgrade\project-upgrade\node_modules\lodash\lodash.js:4925:15
    at baseMerge (D:\projects\...\project\project\project-upgrade\node_modules\lodash\lodash.js:3600:7)
    at baseMergeDeep (D:\projects\...\project\project-upgrade\project-upgrade\node_modules\lodash\lodash.js:3689:9)
    at D:\projects\...\project\project-upgrade\project-upgrade\node_modules\lodash\lodash.js:3603:11
    at D:\projects\...\project\project-upgrade\project-upgrade\node_modules\lodash\lodash.js:4925:15
    at baseMerge (D:\projects\...\project\project-upgrade\project-upgrade\node_modules\lodash\lodash.js:3600:7)
    at baseMergeDeep (D:\projects\...\project\project-upgrade\project-upgrade\node_modules\lodash\lodash.js:3689:9)

I've updated lodash as well to ensure it the most recent version for v9.

dcp3450 commented 4 years ago

I also have "postinstall": "ngcc" in the package.json since I'm running v9 which runs ivy

just-jeb commented 4 years ago

It should be fixed in version 10. We can backport the fix to version 9. Would you like to create a PR for 9.x.x branch?

andsan commented 3 years ago

@just-jeb Where is the PR for 9? I have the same issue.

just-jeb commented 3 years ago

Don't think it was ever ported back to v9. You're welcome to create a PR to branch 9.x.x.