-
Notifications
You must be signed in to change notification settings - Fork 91
feat: add hono standalone builder #119
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
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
| bundle: false, | ||
| }); | ||
|
|
||
| this.buildClientLibrary(); |
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.buildClientLibrary(); | |
| await this.buildClientLibrary(); |
The buildClientLibrary() call is missing the await keyword, causing the build method to potentially return before the client library is finished building. This creates a race condition.
View Details
Analysis
Missing await in LocalBuilder.build() causes race condition with client library generation
What fails: LocalBuilder.build() completes and returns before buildClientLibrary() finishes writing the client library file to disk. Callers awaiting build() may immediately try to access the client library before it's been written, causing file not found errors.
How to reproduce:
// In any code using LocalBuilder
const builder = new LocalBuilder(config);
await builder.build();
// At this point, the client library file may not exist yet because buildClientLibrary() is not awaited
const clientLib = fs.readFileSync(config.clientBundlePath, 'utf-8');Result: Potential FileNotFoundError when trying to access the client library file immediately after build() completes.
Expected: The build() method should not resolve until all async operations, including the client library generation, are complete. Per the method signature async build(): Promise<void>, callers expect a fully completed build when the promise resolves.
Evidence:
buildClientLibrary()is defined asprotected async buildClientLibrary(): Promise<void>in BaseBuilder- The same operation is correctly awaited in StandaloneBuilder:
await this.buildClientLibrary(); - The same operation is correctly awaited in VercelBuildOutputAPIBuilder:
await this.buildClientLibrary(); - All other async operations in
LocalBuilder.build()are properly awaited (lines 34, 41, 48)
No description provided.