eta
eta copied to clipboard
Config Problem & Render Problem
Describe the bug
When I try to overwrite the config of parse I get the first error when I specify only one option "ERROR".
Type '{ raw: string; }' is missing the following properties from type '{ exec: string; interpolate: string; raw: string; }': exec, interpolatedeno-ts(2739)
(property) parse?: {
exec: string;
interpolate: string;
raw: string;
} | undefined
If I specify all options (even if I leave them default except one in my case raw) the engine renders the templates wrong, unfortunately I don't get an error there
To Reproduce Steps to reproduce the behavior:
- Define the Settings with:
parse: { raw: "-" } - Hover over
parse
Seccond Problem:
- Define the Settings with:
parse: { exec: "", interpolate: "=", raw: "-" } - Create a EJS file with the new "raw"
- Render the Template
Expected behavior First Problem: that I do not get an error when I want to change only 1 config
Seccond Problem: that the template is rendered with my newly defined config
Screenshots If applicable, add screenshots to help explain your problem.
Package & Environment Details
- Environment: deno 1.12.0+1ad6575 (canary, x86_64-pc-windows-msvc), v8 9.2.230.14, typescript 4.3.2, Eta v1.12.3

It seems this is a problem with the typings @NewtTheWolf, has this problem stopped Eta from rendering the actual template?
I just tested it again and get this error when I try to start the app
TS2739 [ERROR]: Type '{ raw: string; }' is missing the following properties from type '{ exec: string; interpolate: string; raw: string; }': exec, interpolate
parse: { raw: "-" },
@NewtTheWolf I meant what happens when you disable the TS type checking and just use the compiled JS code. Are there any runtime errors?
i don't get an error, but then the rendering doesn't work properly anymore unfortunately
so i can't specify variables/partials etc anymore
bump
Eta does require you to pass all three values (exec, interpolate, and raw) into config.parse.
If rendering isn't working properly, there is probably another issue happening.
@NewtTheWolf @flleeppyy could you provide a simple reproducible example?
After investigating, I realized that this is "expected" behavior. Eta does not support - or _ as options to config.parse, because they're already recognized as whitespace-trimming characters.
I will add this to the documentation.