Closed kylecribbs closed 1 year ago
I am a dummy, it ended up being because I am not setting fn to anything...
let data = {}
let str = "<%= include('./src/main/resources/ejs_templates/imports/imports.ejs');%>";
var fn = ejs.compile(str, {client:true});
var rendered = fn(data, null, function(path, d){
// include callback logic
var includedTemplate = fileReader.test3(path);
print(includedTemplate)
return includedTemplate;
}, null);
that resolved it
Hello all, was hoping someone can help me understand how I can override or use client:true callback function to fetch the include from database.
To give context, we are using Kotlin and GraalVM to run its JavaScript interpreter with EJS 3.1.8.
Here is what I have tried thus far:
however,
var rendered = fn(data);
is stating: undefined is not a function.if I print just fn, the content is:
so it is a function...
We were thinking this could be an issue because we are technically doing this server side; however, we are specifying
client: true
so we have also tried this:When we execute this we get:
Which to me means, we are not overriding the include fetch appropriately and its using the EJS default include fetch.
Does anyone have any thoughts on how could accomplish this?