You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We recently discovered this NX feature: Sync Generators. We thought it would be useful to run a generator before executing a task (instead of creating an NX run command task with the generator inside it). We tested it, but it seems that the node process enters an infinite loop, and we have to manually kill it to continue using NX (the terminal freezes).
Our case involves a Storybook with components, and we wanted to implement variable visualization within it—to list the variables used in the components. We implemented an NX generator that scans the component library's SCSS files and converts them into an object, which we later import into our MDX Storybook files. The issue is that while I was developing the feature, there were no problems with the sync generator. However, my colleagues reported that their terminals froze when they tried to run the generator.
To debug the problem, I did a fresh install of the project and discovered that it was the syncGenerator feature causing the issue. After switching to NX run commands with dependsOn, the problem no longer occurred.
Expected Behavior
When using the sync generator feature in NX, the generator should execute successfully before running the task, without causing the node process to enter an infinite loop or freezing the terminal. The process should complete normally, allowing the developer to continue using NX.
GitHub Repo
No response
Steps to Reproduce
Create an NX project with Storybook and a component that uses it.
Create a generator that scans SCSS files in a component library and converts the variables into an object (creating a TS file for each story). (This could be done differently; I believe any fs manipulations could cause the problem)
Configure the generator to run before executing the build Storybook task.
Observe that the Node process enters an infinite loop, and the terminal freezes, requiring a manual termination to resume using NX.
( If the issue is not reproducible try to recreate the project )
Please provide a repo with a minimal reproduction so we can properly understand the issue and troubleshoot it. The @nx/js:typescript-sync generator performs fs operations, and it doesn't cause an infinite loop, so it might be specific to the operations done in your sync generator. Also, please try with the latest version of Nx if possible. Several stability fixes landed in the last few versions.
Current Behavior
Hey folks,
We recently discovered this NX feature: Sync Generators. We thought it would be useful to run a generator before executing a task (instead of creating an NX run command task with the generator inside it). We tested it, but it seems that the node process enters an infinite loop, and we have to manually kill it to continue using NX (the terminal freezes).
Our case involves a Storybook with components, and we wanted to implement variable visualization within it—to list the variables used in the components. We implemented an NX generator that scans the component library's SCSS files and converts them into an object, which we later import into our MDX Storybook files. The issue is that while I was developing the feature, there were no problems with the sync generator. However, my colleagues reported that their terminals froze when they tried to run the generator.
To debug the problem, I did a fresh install of the project and discovered that it was the syncGenerator feature causing the issue. After switching to NX run commands with dependsOn, the problem no longer occurred.
Expected Behavior
When using the sync generator feature in NX, the generator should execute successfully before running the task, without causing the node process to enter an infinite loop or freezing the terminal. The process should complete normally, allowing the developer to continue using NX.
GitHub Repo
No response
Steps to Reproduce
( If the issue is not reproducible try to recreate the project )
Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: