-
-
Notifications
You must be signed in to change notification settings - Fork 304
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
fix: replace Duplex with Transform #1577
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using Transform, could you try to add a try catch block around the for loop?
Same for other places you linked the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will need to hit the hay now but if it works then I can explain when I wake up, cheers!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue persists with the change.
The issue origin is in prettier transform:
https://github.com/jhipster/generator-jhipster/blob/9febd8f5d1a62855de8a4f5d2fafe0869186289b/generators/bootstrap/support/prettier-support.ts#L79-L84
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have 10 or more transforms:
https://github.com/jhipster/generator-jhipster/blob/9febd8f5d1a62855de8a4f5d2fafe0869186289b/generators/bootstrap/generator.ts#L230-L262
Others in api execution .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried to identify transforms that are not in objectMode.
Every transform seems to be in objectMode.
Duplex.from
with generator is in readableObjectMode and writableObjectMode, but seems to be the source of the issue.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you add
NODE_DEBUG=stream npx jhipster --defaults
(using node 22.5.x) you would see the error was actually being caught but not being properly handled by the cleanup function.logs
This could possibly relates to how nodejs internal handles async generator, since you have found a workaround for your need, I will try to see if I can workout a minimum repro myself and I think I might've introduced this bug in 22.5 since I made a change in nodejs/node@8e5d88b
Thanks for taking time to respond, cheers!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jakecastelli.
Since this affects current and past releases, would be better to have an issue associated with.
Should I open a new issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually that commit I linked might not be the issue - I tried to build locally without that commit and the issue still persists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be good to have an issue but usually we need a minimum repro first otherwise it becomes less meaningful