-
Notifications
You must be signed in to change notification settings - Fork 141
Merge main and resolve frameworks.tsx conflict #500
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
base: main
Are you sure you want to change the base?
Conversation
# Conflicts: # docs/app/(home)/components/frameworks.tsx
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Caution Review the following alerts detected in dependencies. According to your organization's Security Policy, you must resolve all "Block" alerts before proceeding. Learn more about Socket for GitHub.
|
|
Caution Review the following alerts detected in dependencies. According to your organization's Security Policy, you must resolve all "Block" alerts before proceeding. Learn more about Socket for GitHub.
|
| queue = queue.then(task).catch((err) => { | ||
| console.error(err); | ||
| }); | ||
| return queue; |
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 build queue swallows errors instead of propagating them, causing build failures to be silently logged while the queue appears to succeed. Callers awaiting enqueue() will not be notified of failures.
View Details
📝 Patch Details
diff --git a/packages/builders/src/build-queue.ts b/packages/builders/src/build-queue.ts
index 1fe5d48..5b4e3db 100644
--- a/packages/builders/src/build-queue.ts
+++ b/packages/builders/src/build-queue.ts
@@ -20,6 +20,7 @@ export function createBuildQueue() {
return (task: () => Promise<void>): Promise<void> => {
queue = queue.then(task).catch((err) => {
console.error(err);
+ throw err;
});
return queue;
};
Analysis
Build queue error handling swallows exceptions instead of propagating them
What fails: The createBuildQueue() function in packages/builders/src/build-queue.ts has a .catch() handler (lines 21-23) that logs errors but doesn't rethrow them. This causes the promise chain to resolve successfully even when the task rejects, breaking error propagation to callers of enqueue().
How to reproduce:
const enqueue = createBuildQueue();
// First task succeeds
await enqueue(() => Promise.resolve()); // ✓ resolves
// Second task fails
await enqueue(() => Promise.reject(new Error('Build failed'))); // ✓ resolves (BUG!)
// The promise resolves successfully even though the task failedResult: Callers in packages/astro, packages/nitro, and packages/sveltekit that await enqueue(() => builder.build()) receive a resolved promise even when the build fails. Developers see a console error but the build appears to succeed, masking failures in CI/CD pipelines.
Expected behavior: Per MDN Promise.catch() documentation, when a .catch() handler doesn't rethrow, the promise chain recovers and resolves successfully. The catch handler must explicitly throw to propagate the error. The fix is to rethrow the error after logging:
queue = queue.then(task).catch((err) => {
console.error(err);
throw err; // propagate the error
});
Merged latest main branch to sync with upstream changes, including new Astro framework support and various package updates.
Conflict Resolution
Resolved merge conflict in
docs/app/(home)/components/frameworks.tsx:<title>tags to Astro SVG components (AstroDark, AstroLight, AstroGray) and TanStack component from main💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.