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

Input and output glob patterns throw error: "error parsing glob 'a}{b': unclosed alternate group" when using multiple groups #30617

Open
1 of 4 tasks
tlaurie-cl opened this issue Apr 5, 2025 · 0 comments

Comments

@tlaurie-cl
Copy link

tlaurie-cl commented Apr 5, 2025

Current Behavior

Running a target with an input or output glob pattern throws an error:
error parsing glob 'a}{b': unclosed alternate group; missing '}' (maybe escape '{' with '[{]'?)
in the Nx daemon.log when the pattern:

  • ends with a group
  • uses multiple groups
  • has a path separator

The simplest pattern to reproduce this is {projectRoot}/{a}{b}

Expected Behavior

No error to be thrown. The glob pattern is valid.

GitHub Repo

https://github.com/tlaurie-cl/nx-unclosed-alternate-group

Steps to Reproduce

  1. Run npx nx reset && npx nx run uag:fail
  2. Observe the failure, check daemon.log

Note that while the pattern is {projectRoot}/{a}{b}, the error claims the group is unclosed.

  1. Run npx nx reset && npx nx run uag:pass-1, pass-2, and pass-3
  2. Observe the success.

Note the variants {projectRoot}/{a}{b}c, {projectRoot}/{a}, and {projectRoot}{a}{b} all run without error.

Nx Report

Node           : 18.19.1
OS             : win32-x64
Native Target  : x86_64-windows
npm            : 10.2.4

nx  : 20.7.1
---------------------------------------
Cache Usage: 0.00 B / 47.57 GB

Failure Logs

When the pattern is used as an input:

C:\...\unclosed-alternate-group\node_modules\nx\src\hasher\native-task-hasher-impl.js:33
        const hashes = this.hasher.hashPlans(plans, env);
                                   ^

Error: error parsing glob 'a}{b': unclosed alternate group; missing '}' (maybe escape '{' with '[{]'?)
    at NativeTaskHasherImpl.hashTasks (C:\...\unclosed-alternate-group\node_modules\nx\src\hasher\native-task-hasher-impl.js:33:36)
    at InProcessTaskHasher.hashTasks (C:\...\unclosed-alternate-group\node_modules\nx\src\hasher\task-hasher.js:41:46)
    at handleHashTasks (C:\...\unclosed-alternate-group\node_modules\nx\src\daemon\server\handle-hash-tasks.js:30:56)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async handleResult (C:\...\unclosed-alternate-group\node_modules\nx\src\daemon\server\server.js:186:16)
    at async handleMessage (C:\...\unclosed-alternate-group\node_modules\nx\src\daemon\server\server.js:112:9)
    at async C:\...\unclosed-alternate-group\node_modules\nx\src\daemon\server\server.js:74:9 {
  code: 'GenericFailure'
}


When the pattern is used as an output:

[REQUEST]: Responding to the client with an error. recordOutputsHash failed Critical error when recording metadata about outputs: 'error parsing glob 'a}{b': unclosed alternate group; missing '}' (maybe escape '{' with '[{]'?)'.
Error: Critical error when recording metadata about outputs: 'error parsing glob 'a}{b': unclosed alternate group; missing '}' (maybe escape '{' with '[{]'?)'.
    at handleRecordOutputsHash (C:\...\unclosed-alternate-group\node_modules\nx\src\daemon\server\handle-outputs-tracking.js:17:20)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async handleResult (C:\...\unclosed-alternate-group\node_modules\nx\src\daemon\server\server.js:186:16)
    at async handleMessage (C:\...\unclosed-alternate-group\node_modules\nx\src\daemon\server\server.js:118:9)
    at async C:\...\unclosed-alternate-group\node_modules\nx\src\daemon\server\server.js:74:9

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)
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