-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failure upgrading to 15.9.2 and running migrations for jest 29 - update-tests-jest-29 #16426
Comments
@asherccohen can you share the project.json of the 'api-client' project before the migration ran? |
@barbados-clemens i can provide info if required, im very interested in fixing this issue, i'll have to upgrade my monorepo soon, and at the moment i can't. |
@barbados-clemens i've seen that the 'npx nx migrate --run-migrations' fails when it has to change the jest config of the right file of the image, the left one works fine |
@jordi72 can you share the full stack trace of the error you're seeing when trying to migrate? |
I cannot share the plain log but i can share a short version. I have to mention that i've changed the structure of the jest file with a module.export to the export default format, and i can pass that point, now in having another error but the same description. Migration Log
Might be probably because angular/cli is not in version 15? |
I am also receiving this same error when upgrading to 15.9.2
if I remove these migrations it works obviously due to not doing the jest migration
|
@jberrydev can you rerun the migration with the --verbose flag to get the stacktrace? |
@barbados-clemens here is my original terminal log, sorry for the delay. Logs$ npx nx migrate --run-migrations --verbose
> NX Running 'npm install' to make sure necessary packages are installed
> [email protected] postinstall
> node ./decorate-angular-cli.js && ngcc --properties es2015 browser module main
Angular CLI could not be decorated to enable computation caching. Please ensure @nrwl/workspace is installed.
> [email protected] prepare
> husky install
husky - Git hooks installed
removed 7 packages, changed 1 package, and audited 2437 packages in 6s
357 packages are looking for funding
run `npm fund` for details
3 high severity vulnerabilities
To address all issues, run:
npm audit fix
Run `npm audit` for details.
> NX Running migrations from 'migrations.json'
> NX NOTE Use "nx show projects" to read the list of projects.
If you read the list of projects from angular.json, use "nx show projects" instead.
Ran 15-7-0-split-configuration-into-project-json-files from @nrwl/workspace
Split global configuration files into individual project.json files. This migration has been added automatically to the beginning of your migration set to retroactively make them work with the new version of Nx.
UPDATE some of project.json
DELETE angular.json
UPDATE tsconfig.base.json
---------------------------------------------------------
Ran 14-2-0-add-json-schema from nx
Add JSON Schema to Nx configuration files
UPDATE nx.json
UPDATE more project.json
---------------------------------------------------------
Ran 14-2-0-remove-default-collection from nx
Remove default collection from configuration to switch to prompts for collection
UPDATE nx.json
---------------------------------------------------------
Ran 14.3.4-create-target-defaults from nx
Replace targetDependencies with targetDefaults
UPDATE nx.json
---------------------------------------------------------
Ran 15.0.0-migrate-to-inputs from nx
Replace implicitDependencies with namedInputs + target inputs
UPDATE nx.json
---------------------------------------------------------
Ran 15.0.0-prefix-outputs from nx
Prefix outputs with {workspaceRoot}/{projectRoot} if needed
UPDATE apps/Project/project.json
UPDATE mooore project.json
---------------------------------------------------------
Ran add-eslint-inputs from @nrwl/linter
Stop hashing eslint config files for build targets and dependent tasks
UPDATE nx.json
---------------------------------------------------------
Ran add-eslint-ignore from @nrwl/linter
Add node_modules to root eslint ignore
CREATE .eslintignore
---------------------------------------------------------
Ran add-cypress-inputs from @nrwl/cypress
Stop hashing cypress spec files and config files for build targets and dependent tasks
UPDATE nx.json
---------------------------------------------------------
unable to update file because it doesn't exist or is not a js or ts file. Config: libs/jest.config.js. Exists?: false
Ran exclude-jest-config-from-ts-config from @nrwl/jest
Exclude jest.config.ts from tsconfig where missing.
UPDATE tsconfig files
---------------------------------------------------------
Ran add-jest-inputs from @nrwl/jest
Stop hashing jest spec files and config files for build targets and dependent tasks
UPDATE nx.json
---------------------------------------------------------
> NX Jest Snapshot format changed in v29.
By default Nx kept the older style to prevent breaking of existing tests with snapshots.
It's recommend you update to the latest format.
You can do this in your project's jest config file.
Remove the snapshotFormat property and re-run tests with the --update-snapshot flag.
More info: https://jestjs.io/docs/upgrading-to-jest29#snapshot-format
Ran update-configs-jest-29 from @nrwl/jest
Update jest configs to support jest 29 changes (https://jestjs.io/docs/upgrading-to-jest29)
UPDATE jest.config.ts files
UPDATE jest.preset.js
---------------------------------------------------------
> NX Failed to run update-tests-jest-29 from @nrwl/jest. This workspace is NOT up to date!
> NX Cannot find configuration for 'delivery-notes-feature-list' //My comment: <--- The file with the export.module syntax
Error: Cannot find configuration for 'delivery-notes-feature-list'
at readProjectConfiguration (C:\Users\myuser\Workspace\Project-2\node_modules\nx\src\generators\utils\project-configuration.js:90:15)
at C:\Users\myuser\Workspace\Project-2\node_modules\@nrwl\jest\src\migrations\update-15-8-0\update-tests-jest-29.js:13:73
at forEachProjectConfig (C:\Users\myuser\Workspace\Project-2\node_modules\@nrwl\devkit\src\generators\executor-options-utils.js:38:17)
at forEachExecutorOptionsInGraph (C:\Users\myuser\Workspace\Project-2\node_modules\@nrwl\devkit\src\generators\executor-options-utils.js:28:5)
at C:\Users\myuser\Workspace\Project-2\node_modules\@nrwl\jest\src\migrations\update-15-8-0\update-tests-jest-29.js:12:68
at Generator.next (<anonymous>)
at fulfilled (C:\Users\myuser\Workspace\Project-2\node_modules\tslib\tslib.js:164:62)
Command failed: npx nx _migrate --run-migrations --verbose
> NX Command failed: npx nx migrate --run-migrations --verbose
Error: Command failed: npx nx migrate --run-migrations --verbose
at checkExecSyncError (node:child_process:828:11)
at execSync (node:child_process:902:15)
at runNxSync (C:\Users\MYUSER~1\AppData\Local\Temp\tmp-8436-zUiCKvX7ZDig\node_modules\nx\src\utils\child-process.js:26:34)
at C:\Users\MYUSER~1\AppData\Local\Temp\tmp-8436-zUiCKvX7ZDig\node_modules\nx\src\command-line\migrate.js:935:43
at Generator.next (<anonymous>)
at C:\Users\MYUSER~1\AppData\Local\Temp\tmp-8436-zUiCKvX7ZDig\node_modules\tslib\tslib.js:167:75
at new Promise (<anonymous>)
at Object.__awaiter (C:\Users\MYUSER~1\AppData\Local\Temp\tmp-8436-zUiCKvX7ZDig\node_modules\tslib\tslib.js:163:16)
at runMigrations (C:\Users\MYUSER~1\AppData\Local\Temp\tmp-8436-zUiCKvX7ZDig\node_modules\nx\src\command-line\migrate.js:928:20)
at Object.<anonymous> (C:\Users\MYUSER~1\AppData\Local\Temp\tmp-8436-zUiCKvX7ZDig\node_modules\nx\src\command-line\migrate.js:1046:23)
Command failed: C:\Users\MYUSER~1\AppData\Local\Temp\tmp-8436-zUiCKvX7ZDig\node_modules\.bin\nx _migrate --run-migrations --verbose |
@jordi72 can you share the project.json before the migration of the "test": {
"executor": "@nrwl/jest:jest",
"options": {
"jestConfig": "path/to/project/jest.config.ts"
}
} (I've also edited your comment to make it more readable with the long logs) |
project.json (of delivery-notes-feature-list) {
"projectType": "library",
"root": "libs/delivery-notes/feature-list",
"sourceRoot": "libs/delivery-notes/feature-list/src",
"prefix": "delivery-notes",
"targets": {
"build": {
"executor": "@nrwl/angular:ng-packagr-lite",
"outputs": ["dist/libs/delivery-notes/feature-list"],
"options": {
"project": "libs/delivery-notes/feature-list/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "libs/delivery-notes/feature-list/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "libs/delivery-notes/feature-list/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/libs/delivery-notes/feature-list"],
"options": {
"jestConfig": "libs/delivery-notes/feature-list/jest.config.js",
"passWithNoTests": true
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": [
"libs/delivery-notes/feature-list/src/**/*.ts",
"libs/delivery-notes/feature-list/src/**/*.html"
]
}
}
},
"tags": ["domain:delivery-notes", "type:feature"]
} jest.config.js (of delivery-notes-feature-list) (not sure if your asking for this file) module.exports = {
displayName: 'distributors-feature-components',
preset: '../../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
},
coverageDirectory: '../../../coverage/libs/distributors/feature-components',
transform: {
'^.+\\.(ts|mjs|js|html)$': 'jest-preset-angular',
},
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
}; |
@jordi72 what version of Nx were you migrating from? |
@barbados-clemens 14.1.9 |
@jordi72 @jberrydev can y'all try migrating to the latest major version of nx you're on first. there was a lot of changes in the project inferences that happened between v14-v15 and being on an earily version of v14 I wonder if there is an issue where things are getting cross as you're migrating across almost two whole nx versions. another thing is if it's a single troubled project you could try adding the 'name' property in the project.json just so Nx doesn't try to infer the name. |
@barbados-clemens im getting this error #16161 |
@jordi72 that looks like this issue #16161 which looks to be resolved. @jberrydev and @asherccohen can you confirm upgraded to the latest of your current nx major version first before trying to jump to the next major solves the issue for you? i.e. if you're on nx 13 currently # migrate to latest v13 first
nx migrate 13.10.5
nx migrate --run-migrations # if there were migrations.json to run
# then to latest v14
nx migrate 14.8.8
nx migrate --run-migrations
# finally
nx migrate latest
nx migrate --run-migrations |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
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. |
Current Behavior
projectName does not match if lib is in a nested folder.
node_modules/@nrwl/devkit/src/generators/executor-options-utils.js
line 33
projectName is the name of the folder
Expected Behavior
node_modules/@nrwl/devkit/src/generators/executor-options-utils.js
line 33
projectName is the name defined in project.json
GitHub Repo
No response
Steps to Reproduce
Nx Report
Failure Logs
Additional Information
No response
The text was updated successfully, but these errors were encountered: