Open
Description
Issue type:
- 🐛 Bug
Description:
I am getting an error saying:
ErrorResourcesContext: Parameter value "@css:templates/main.html.ejs" is not of required range type "http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON"
From this config:
{
"@type": "EjsTemplateEngine",
"EjsTemplateEngine:_template": "@css:templates/main.html.ejs"
}
Because the template
arg of EjsTemplateEngine
is supposed to be able to accept a string or a json object.
export class EjsTemplateEngine<T extends Dict<any> = Dict<any>> implements TemplateEngine<T> {
/**
* @param template - The default template @range {json}
*/
public constructor(template?: Template) {
}
}
Using a json field in this way errors because the string cannot be parsed by JSON.parse()
here:
JSON fields should accept strings because strings are valid JSON.
Environment:
components.js v4.5.0
nodejs v16.14.0