eta icon indicating copy to clipboard operation
eta copied to clipboard

Config Problem & Render Problem

Open NewtTheWolf opened this issue 4 years ago • 6 comments

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:

  1. Define the Settings with: parse: { raw: "-" }
  2. Hover over parse

Seccond Problem:

  1. Define the Settings with: parse: { exec: "", interpolate: "=", raw: "-" }
  2. Create a EJS file with the new "raw"
  3. 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

NewtTheWolf avatar Aug 20 '21 13:08 NewtTheWolf

problem

NewtTheWolf avatar Aug 20 '21 13:08 NewtTheWolf

It seems this is a problem with the typings @NewtTheWolf, has this problem stopped Eta from rendering the actual template?

shadowtime2000 avatar Sep 02 '21 16:09 shadowtime2000

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 avatar Sep 03 '21 10:09 NewtTheWolf

@NewtTheWolf I meant what happens when you disable the TS type checking and just use the compiled JS code. Are there any runtime errors?

shadowtime2000 avatar Sep 03 '21 15:09 shadowtime2000

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

NewtTheWolf avatar Sep 04 '21 16:09 NewtTheWolf

bump

flleeppyy avatar Apr 20 '22 19:04 flleeppyy

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?

bgub avatar Jan 31 '23 05:01 bgub

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.

bgub avatar May 06 '23 20:05 bgub