Skip to content
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

Nx on Windows fails to run any tasks for monorepo #29551

Open
1 of 4 tasks
molisani opened this issue Jan 8, 2025 · 0 comments
Open
1 of 4 tasks

Nx on Windows fails to run any tasks for monorepo #29551

molisani opened this issue Jan 8, 2025 · 0 comments

Comments

@molisani
Copy link

molisani commented Jan 8, 2025

Current Behavior

For any commands that run project tasks, the following error is reported:

 NX   Cannot read properties of undefined (reading 'allWorkspaceFiles')

This is only happening for our monorepo for users running from native Windows.

Expected Behavior

Expect the tasks to run as they would in WSL or macOS or native Linux.

GitHub Repo

Internal Repo

Steps to Reproduce

  1. npm ci
  2. npx nx run-many -t build --verbose

Running npx nx show projects also fails, but it just doesn't print anything and ends without error.

Nx Report

Node           : 20.10.0
OS             : win32-x64
Native Target  : wasm32
npm            : 10.9.1

nx             : 20.2.1
@nx/js         : 20.2.1
@nx/eslint     : 20.2.1
@nx/workspace  : 20.2.1
@nx/devkit     : 20.2.1
@nx/rollup     : 20.2.1
@nx/webpack    : 20.2.1
typescript     : 5.7.2

Failure Logs

TypeError: Cannot read properties of undefined (reading 'allWorkspaceFiles')
    at new NativeTaskHasherImpl (C:\...\monorepo\node_modules\nx\src\hasher\native-task-hasher-impl.js:11:47)
    at new InProcessTaskHasher (C:\...\monorepo\node_modules\nx\src\hasher\task-hasher.js:36:27)
    at createTaskHasher (C:\...\monorepo\node_modules\nx\src\hasher\create-task-hasher.js:13:16)
    at invokeTasksRunner (C:\...\monorepo\node_modules\nx\src\tasks-runner\run-command.js:369:60)
    at runCommandForTasks (C:\...\monorepo\node_modules\nx\src\tasks-runner\run-command.js:117:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async C:\...\monorepo\node_modules\nx\src\tasks-runner\run-command.js:105:29
    at async handleErrors (C:\...\monorepo\node_modules\nx\src\utils\handle-errors.js:8:24)
    at async runCommand (C:\...\monorepo\node_modules\nx\src\tasks-runner\run-command.js:104:20)
    at async Object.runMany (C:\...\monorepo\node_modules\nx\src\command-line\run-many\run-many.js:43:24)

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

This appears to be some kind of issue with the task hasher and specifically the externals argument passed to InProcessTaskHasher and NativeTaskHasherImpl. Because this repo does not have strictNullChecks enabled, this property can be null when passed to NativeTaskHasherImpl which does not expect it to be null/undefined. And when storedFileMap is null-ish here that value is always null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant