-
Notifications
You must be signed in to change notification settings - Fork 463
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
Prevent non-terminating build #5485
Conversation
using generatedFileExtension in gentypeconfig
rescript
Outdated
@@ -28,6 +28,8 @@ var lockFileName = path.join(cwd, ".bsb.lock"); | |||
process.env.BSB_PROJECT_ROOT = cwd; | |||
// console.log('BSB_PROJECT_ROOT:', process.env.BSB_PROJECT_ROOT) | |||
|
|||
var generatedFileExtension = require(path.join(cwd, "bsconfig.json")).gentypeconfig.generatedFileExtension; |
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.
What if gentypeconfig
does not exist?
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.
It is undefined
, and fileName.endsWith(undefined)
evaluates to false
. I can add a guard and provide a default value, e.g., .gen.tsx
, if this seems too dangerous, though.
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.
It's actually going to crash if gentypeconfig
is not specified in bsconfig.json
.
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.
This is my bad. I'll fix it.
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 you also rename it? Should indicate it's for gentype.
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.
Did you manage to reproduce the issue, and verify that it does not happen anymore after this?
@cristianoc Yes, I did reproduce and verified that it did fix the error. I personally suffered from this issue and found the issue mentioned above from searching. I'm currently not in front of the computer, and I'll resolve the issues mentioned above when I get back. I'm sorry for the inconvenience! |
Thanks a lot for doing the fix! |
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.
Looking great!
Ready to merge? Is it tested?
Yes, it does work for bsconfig.json with or without gentypeconfig, and with or without generatedFileExtension. |
using generatedFileExtension in gentypeconfig
This can fix non-terminating build due to custom generated file extensions (#5303).