-
Notifications
You must be signed in to change notification settings - Fork 2.7k
fix: improve workflow validation error logging and display #8594
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
- Add zodErrorLogger utility for clean, structured Zod error logging - Enhanced workflow validation error messages with specific field names and node numbers - Improved .env.local loading in Vite config using loadEnv() - Simplified error handling in migration parsing - Single console.error per validation failure with complete error details - User-friendly toast notifications with truncated error summaries Fixes workflow validation error debugging for generated templates.
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! This logic hasn't been revisited since zod v4 was released. Zod now ships with a way to make its errors more user-friendly: https://zod.dev/error-formatting?id=zprettifyerror#zprettifyerror
Could you please try this utility? If it works well, we could remove the dependency on zod-validation-error
and not need to worry about parsing zod errors ourselves.
} catch (e) { | ||
// Log file parsing/loading errors | ||
if (e instanceof SyntaxError) { | ||
// eslint-disable-next-line no-console | ||
console.error('Workflow file JSON parsing failed:', { | ||
fileName: file.name, | ||
error: e.message, | ||
}); | ||
} else { | ||
// eslint-disable-next-line no-console | ||
console.error('Workflow file loading failed:', { | ||
fileName: file.name, | ||
error: e, | ||
}); | ||
} |
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.
Lets use the app logger here.
Summary
This PR fixes validation error debugging for workflow templates by improving error logging and display.
The main focus is on making workflow validation errors easier to debug by providing clear, actionable error information to developers (via
console.error()
) while maintaining a good user experience in the toast.Previously the toast would output incomplete error messaging that was not very useful for debugging.
Now the toast shows the invalid field names in addition to the failure, while maintaining the truncation ("+40 more...") if there are many failures. But the developer console shows the full error object which can be used for debugging.
Also adds support for an optional
INVOKEAI_API_BASE_URL
env var for development, to allow the frontend server and the InvokeAI API server it proxies to be on separate machines.Checklist
What's New
copy (if doing a release after this PR)