nx: Running nx migrate update-jest-config-to-use-util results in Cannot read property 'filter' of undefined
Current Behavior
Migration failure
nx migrate --run-migrations=migrations.json --verbose fails with (absolute paths removed):
...
---------------------------------------------------------
Running migration support-jest-27
Successfully finished support-jest-27
---------------------------------------------------------
Running migration update-ts-jest-and-jest-preset-angular
Successfully finished update-ts-jest-and-jest-preset-angular
---------------------------------------------------------
Running migration update-jest-config-to-use-util
Cannot read property 'filter' of undefined
TypeError: Cannot read property 'filter' of undefined
at determineUncoveredJestProjects (./node_modules/@nrwl/jest/src/migrations/update-12-6-0/update-base-jest-config.js:13:29)
at updateBaseJestConfig (./node_modules/@nrwl/jest/src/migrations/update-12-6-0/update-base-jest-config.js:28:35)
at ./node_modules/@nrwl/jest/src/migrations/update-12-6-0/update-base-jest-config.js:36:9
at Generator.next (<anonymous>)
at ./node_modules/tslib/tslib.js:117:75
at new Promise (<anonymous>)
at Object.__awaiter (./node_modules/tslib/tslib.js:113:16)
at update (./node_modules/@nrwl/jest/src/migrations/update-12-6-0/update-base-jest-config.js:35:20)
at /private/var/folders/9w/5cny_c711x340yk5j0kq_23c0000gn/T/tmp-6964-ZXlphEt740h4/node_modules/@nrwl/tao/src/commands/migrate.js:542:15
at Generator.next (<anonymous>)
Command failed: /var/folders/9w/5cny_c711x340yk5j0kq_23c0000gn/T/tmp-6964-ZXlphEt740h4/node_modules/.bin/tao migrate --run-migrations --verbose
Expected Behavior
Successful migration
> NX Successfully finished running migrations from 'migrations.json'
Steps to Reproduce
> git clean -f
> rm -rf node_modules
> yarn install
> npx nx migrate latest
> yarn install
> npx nx migrate --run-migrations=migrations.json --verbose
This is my first time using nx migrate, but if I take update-jest-config-to-use-util out of migrations.json it succeeds.
Failure Logs
Included in current behavior section above.
Environment
> npx nx report
> NX Report complete - copy this into the issue template
Node : 12.16.3 OS : darwin x64 yarn : 1.22.4
nx : Not Found @nrwl/angular : 12.6.3 @nrwl/cli : 12.6.3 @nrwl/cypress : 12.6.3 @nrwl/devkit : 12.6.3 @nrwl/eslint-plugin-nx : Not Found @nrwl/express : Not Found @nrwl/jest : 12.6.3 @nrwl/linter : 12.6.3 @nrwl/nest : Not Found @nrwl/next : Not Found @nrwl/node : Not Found @nrwl/nx-cloud : Not Found @nrwl/react : Not Found @nrwl/schematics : Not Found @nrwl/tao : 12.6.3 @nrwl/web : Not Found @nrwl/workspace : 12.6.3 @nrwl/storybook : 12.6.3 @nrwl/gatsby : Not Found typescript : 4.3.5
From the migration.json file:
{
"version": "12.6.0-beta.0",
"cli": "nx",
"description": "Uses `getJestProjects()` to populate projects array in root level `jest.config.js` file.",
"factory": "./src/migrations/update-12-6-0/update-base-jest-config",
"package": "@nrwl/jest",
"name": "update-jest-config-to-use-util"
}
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 15 (6 by maintainers)
@aspergillusOryzae the fix is in master now but it hasn’t been released yet, it will be included in the next patch release.
@aspergillusOryzae I’ll be pushing a fix for this issue soon. In the meantime, you can read this comment where a workaround was provided.
Experienced the same issue after updating to 12.6.3