-
Notifications
You must be signed in to change notification settings - Fork 141
feat: add nestjs support #514
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
🦋 Changeset detectedLatest commit: a5cb073 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
e281a06 to
a5cb073
Compare
| async onModuleInit() { | ||
| await enqueue(() => localBuilder.build()); |
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.
Build failures during module initialization are silently swallowed due to error handling in createBuildQueue(). If the build fails at startup, the module still completes initialization successfully, causing later HTTP requests to fail with import errors instead of a clear build failure message.
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 failures during NestJS module initialization are silently swallowed
What fails: createBuildQueue() in packages/builders/src/build-queue.ts has a .catch() handler that logs errors but doesn't re-throw them. When the build fails during WorkflowModule.onModuleInit(), the error is swallowed and module initialization completes successfully. Later, HTTP requests to WorkflowController fail with import errors instead of a clear build failure.
How to reproduce:
- Create an invalid workflow that causes
localBuilder.build()to throw an error - Boot a NestJS application using
WorkflowModule.forRoot() - Observe that module initialization completes without error (despite build failure)
- Send an HTTP request to
POST /.well-known/workflow/v1/step - Request fails with import error:
Cannot find module '.nestjs/workflow/steps.mjs'instead of the original build error
Result: The build error is logged to console but never propagated. Module initializes successfully. HTTP request fails with confusing import error instead of meaningful build failure message.
Expected: Build errors should be propagated during module initialization, causing the module to fail startup with a clear error message about what went wrong in the build.
Root cause: In packages/builders/src/build-queue.ts, the promise chain ends with .catch((err) => { console.error(err); }) which handles the error but doesn't re-throw it, causing the promise to resolve successfully even when the task fails. This is intentional for hot-reload scenarios but inappropriate for initialization where errors must be propagated.
Fix: Add throw err; in the catch handler to re-throw errors and allow them to propagate to callers.
No description provided.