Closed morandd closed 1 year ago
@morandd, everything is correct with your code except one small detail -- you need to import Eta from index.ts
, not core.ts
. The full correct import should be:
import { Eta } from "https://deno.land/x/eta@v3.1.0/src/index.ts";
Sorry for the confusion!
Describe the bug Does not work on a simple example using latest deno and v3.1.0
To Reproduce
Create a simple template file like this:
mkdir templates; echo "hello world" > templates/test.eta
Create a simple Eta test script like this "test.js":
const eta = new Eta({ views: Deno.cwd() + '/templates' })
const res = eta.render("./test.eta", { name: "Ben" }) console.log(res) // Hi Ben!
error: Uncaught Eta Error: Failed to get template './test.eta' throw new EtaError("Failed to get template '" + template + "'"); ^ at Eta.handleCache (https://deno.land/x/eta@v3.1.0/src/render.ts:34:13) at Eta.render (https://deno.land/x/eta@v3.1.0/src/render.ts:53:30) at file:///[LOCAL PATH HIDDEN FOR PRIVACY]/test.js:6:17