Closed gurgunday closed 1 year ago
I have the same issue here. I looked up and engine.configure actually exists in the code itself. https://github.com/fastify/point-of-view/blob/db34d0e63fa85ec8adc5a1e43dd64d1b6b710465/index.js#L672-L675
* [x] I have written a descriptive issue title
* [x] I have searched existing issues to ensure the bug has not already been reported
4.22.2
8.0.0
20.6.1
Ubuntu Server LTS
22.04.3 LTS
Yeah but if eta does not have .configure than...
Yeah but if eta does not have .configure than...
So eta broke the compatibility?
I dont think so. Looking at the unit test, eta is wrong initialized.
It should be done like this according the unit tests:
const { Eta } = require('eta')
const path = require("path");
const app = require("fastify")();
app.register(require("@fastify/view"), {
engine: {
eta: new Eta(),
},
root: path.join(__dirname, "view"),
});
app.get("/", function (req, rep) {
rep.view("index.eta");
});
app.listen({
port: 3000,
host: "127.0.0.1",
});
Yeah, this was not the case in v1/2 if I'm not mistaken
After v3, it ought to be initialized like how @Uzlopak did
It works on my end, feel free to comment if the issue persists
Prerequisites
Fastify version
4
Plugin version
latest
Node.js version
20
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
Latest
Description
Eta no longer works (it had a major rewrite in v3, could be related)
Steps to Reproduce
GET
request to/
returns:{"statusCode":500,"error":"Internal Server Error","message":"engine.configure is not a function"}
Expected Behavior
No response