Closed pablomarttiins closed 12 months ago
4.18.0
8.0.0
18.16.0
Linux
20.04.6 LTS
After installing the lib and configuring it, I am getting the error: reply.view is not a function
Instalei a lib com:
npm i @fastify/view
I performed the configuration in app.ts.
The configuration was done as follows:
app.register(fastifyView, { engine: { ejs: ejs }, root: path.join(__dirname, 'views'), layout: "./templates/template", viewExt: "ejs", propertyName: "render", defaultContext: { dev: process.env.NODE_ENV === "dev", }, options: {}, })
No response
Well, it’s because you set the propertyName property to render
propertyName
render
You should do reply.render(), or remove propertyName from options
reply.render()
Closing this but feel free to write back if the problem isn’t solved
Prerequisites
Fastify version
4.18.0
Plugin version
8.0.0
Node.js version
18.16.0
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
20.04.6 LTS
Description
After installing the lib and configuring it, I am getting the error: reply.view is not a function
Steps to Reproduce
Instalei a lib com:
npm i @fastify/view
I performed the configuration in app.ts.
The configuration was done as follows:
app.register(fastifyView, { engine: { ejs: ejs }, root: path.join(__dirname, 'views'), layout: "./templates/template", viewExt: "ejs", propertyName: "render", defaultContext: { dev: process.env.NODE_ENV === "dev", }, options: {}, })
Expected Behavior
No response