Closed wbrown766 closed 2 years ago
Please check https://medium.com/@fastifyjs/fastify-v4-ga-59f2103b5f0e
You need explicit return of reply
in async
handler.
If you believe it is not the same issue or cause. Please provide a minimal repo that can run directly.
You current example missing too many pieces like ../moduals/config
is unknown to me. There is no call of reply.render
.
Sorry complety missed that. Didn't even reaslie it was related as I was get a FST_ERR_REP_ALREADY_SENT not a FST_ERR_PROMISE_NOT_FULFILLED error.
It was rather late las night... SORRY... works fine now.
Prerequisites
Fastify version
4.0.3
Plugin version
7.0.0
Node.js version
16.15.1
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
Kernel verion 5.4.0-120-generic x86_64 bits
Description
So I have a server set up and and I use ejs templating to render dynamic pages. All worked on fastify v3.29.0 with point-of-view v5.3.0 befor I upgraded to v4.0.3 and v7.0.0 respectively. I was looking to to try out ajv v8 hence the upgrade but anyway.
My the view pluging is autoloaded and I call reply.render to render ejs when needed but i get an FST_ERR_REP_ALREADY_SENT error ever time.
All other routes that return static content work fine. i.e. via @fastify/static or reply.send(JSON.stringify(...data...))
Steps to Reproduce
My the view pluging is autoloaded and looks like this
the problem is every time i call reply.render(...) it outputs this error
I tried taking out the propertyName and calling reply.view but got same error
Expected Behavior
No response