-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
When onError
hook is defined, failure to compile template crashes server (ejs)
#404
Comments
onError
hook is defined, failure to compile template crashes serveronError
hook is defined, failure to compile template crashes server (ejs)
The first The double-call to |
This issue is solved by #405 |
Great! Can you please add a unit test to #405 and put |
Fixes fastify#404 Add a regression test for previously incorrect behavior: when the `fastify` instance had an `onError` added, errors thrown by renderer resulted in server crash.
Closes fastify#404 Add a regression test for previously incorrect behavior: when the `fastify` instance had an `onError` added, errors thrown by renderer resulted in server crash.
@gurgunday Added the test, but it didn't link this issue to the PR or vice versa. I assume because I am not a collaborator/member of this repo? 🤷♂️ |
* refactor(index): async flow control * refactor(index): factor up all html minification * refactor(index): remove readCallbackEnd * refactor(index): factor up all undefined `page` checks * refactor(index): review nits - viewDecorator: remove spurious defined check - decorateReply: capitalize getHeader check - minify definition: null instead of false when not enabled - getRequestedPath: remove spurious optional chaining - use optional chaining for layout checks - avoid “assign to `x` then return `x`” pattern * test(ejs): add test for invalid template Closes #404 Add a regression test for previously incorrect behavior: when the `fastify` instance had an `onError` added, errors thrown by renderer resulted in server crash. * refactor(index): avoid reading the same file concurrently --------- Co-authored-by: uzlopak <aras.abbasi@googlemail.com>
Prerequisites
Fastify version
4.26.0
Plugin version
8.2.0
Node.js version
20.x
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
13.6.4
Description
When fastify has an
onError
hook defined, attempts to render an invalid template result in a server crash due to multiple calls tosend
.I am using the
ejs
engine and have only confirmed the bug with that engine.Steps to Reproduce
Upon loading in a browser:
After commenting out the
onError
hook:Expected Behavior
Regardless of whether
onError
has been defined, failure to compile template should return an error to the client, rather than crashing the server.The text was updated successfully, but these errors were encountered: