← All tasks
javascriptlint-staged/lint-staged #1338Not a task: not reproduced

After update to 15.0.1, lerna + nx + lint-staged fails

envgap__lint-staged__lint-staged-1338

01 / FAILURE SIGNATURE

As reported upstream

@taquito/utils: TypeError: Cannot read properties of undefined (reading 'collapseSubtasks')
Not a benchmark task.
  • In a clean container the reported failure did not reproduce, or the known fix did not make the project run.

02 / ENVIRONMENT RECIPE

Base commit
500f45fffc74cf43d148e2097c3640265d710f3e
Manifest
package.json
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

lint-staged/lint-staged #1338 · read the original issue
Please note that debug logs are useless, as the task succeeds when run directly, or via `lerna` while `nx` is `false`.



In [this PR](https://github.com/ecadlabs/taquito/pull/2693) in Taquito, after updating to `lint-staged 15.x` (this commit: `3b5e372c6d02082667c4934691c4079c36988c83`) , the task `npm run commit` fails with the following errors:



```

@taquito/utils: > @taquito/utils@17.3.2 precommit

@taquito/utils: > lint-staged

✔ Preparing lint-staged...

@taquito/utils: ❯ Running tasks for staged files...

@taquito/utils:   ❯ package.json — 2 files

@taquito/utils:     ❯ {src,test}/**/*.ts — 1 file

@taquito/utils:       ✔ prettier --write

@taquito/utils:       ✔ eslint --fix

@taquito/utils: ◼ Applying modifications from tasks...

@taquito/utils: ◼ Cleaning up temporary files...

@taquito/utils: file:///home/alireza/work/ecad/taquito/node_modules/listr2/dist/index.js:914

@taquito/utils:         task.subtasks.some((subtask) => subtask.rendererOptions.collapseSubtasks === false) || // if any of the subtasks has failed

@taquito/utils:                                                                 ^

@taquito/utils: TypeError: Cannot read properties of undefined (reading 'collapseSubtasks')

@taquito/utils:     at file:///home/alireza/work/ecad/taquito/node_modules/listr2/dist/index.js:914:65

@taquito/utils:     at Array.some (<anonymous>)

@taquito/utils:     at file:///home/alireza/work/ecad/taquito/node_modules/listr2/dist/index.js:914:23

@taquito/utils:     at Array.flatMap (<anonymous>)

@taquito/utils:     at _DefaultRenderer.renderer (file:///home/alireza/work/ecad/taquito/node_modules/listr2/dist/index.js:810:18)

@taquito/utils:     at _DefaultRenderer.create (file:///home/alireza/work/ecad/taquito/node_modules/listr2/dist/index.js:713:30)

@taquito/utils:     at _DefaultRenderer.update (file:///home/alireza/work/ecad/taquito/node_modules/listr2/dist/index.js:694:23)

@taquito/utils:     at file:///home/alireza/work/ecad/taquito/node_modules/listr2/dist/index.js:686:14

@taquito/utils:     at Timeout._onTimeout (file:///home/alireza/work/ecad/taquito/node_modules/listr2/dist/index.js:537:9)

@taquito/utils:     at listOnTimeout (node:internal/timers:569:17)

@taquito/utils: Node.js v18.18.1

@taquito/utils: npm ERR! Lifecycle script `precommit` failed with error: 

@taquito/utils: npm ERR! Error: command failed 

@taquito/utils: npm ERR!   in workspace: @taquito/utils@17.3.2 

@taquito/utils: npm ERR!   at location: /home/alireza/work/ecad/taquito/packages/taquito-utils 

```



Project config:

`packages/taquito-utils/package.json`:

```

  "scripts": {

    "lint": "eslint --ext .js,.ts .",

    "precommit": "lint-staged"

  },

  "lint-staged": {

    "{src,test}/**/*.ts": [

      "prettier --write",

      "eslint --fix"

    ]

  },

```

`.husky/pre-commit`:

```

#!/bin/sh

. "$(dirname "$0")/_/husky.sh"



npm run precommit

```

`package.json`:

```

    "commit": "git-cz",

    "precommit": "lerna run --concurrency 1 --stream precommit",

```

and finally, `lerna.json`:



```

{

  "useNx": true,

  "version": "17.3.2"

}

```

Please note that if I set `"useNx": false`, everything will be fine.



<!-- Tell us about your development environment -->

- **OS:** Fedora 38

- **Node.js:** 18.18.1

- **`lint-staged`:** 15.0.1

Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]