glint icon indicating copy to clipboard operation
glint copied to clipboard

SVG-children lead to a type error

Open boris-petrov opened this issue 3 months ago • 4 comments

<svg width="100%" height="100%">
  <text textLength="100%">foobar</text>
</svg>

This leads to: Argument of type '{ textLength: string; }' is not assignable to parameter of type 'never'. On the text element.

Version 1.7.0.

cc @NullVoxPopuli

boris-petrov avatar Oct 31 '25 12:10 boris-petrov

We see all sorts of errors with SVGs for example:

      <svg
        width="103px"
        height="27px"
        viewBox="0 0 103 27"
        version="1.1"
      >
        <defs>
          <polygon
            id="path-1"
            points="4.56610247 0.0328177059 0 0.0328177059 0 10.0018796 9.13220494 10.0018796 9.13220494 0.0328177059 4.56610247 0.0328177059"
          ></polygon>
        </defs>
      </svg>

produces error:

Argument of type '{ id: string; points: string; }' is not assignable to parameter of type 'never'.glint(2345)

LucasHillDex avatar Oct 31 '25 15:10 LucasHillDex

I haven't been able to repro this in the Glint repo -- do you have a project I could use to debug?

NullVoxPopuli avatar Oct 31 '25 16:10 NullVoxPopuli

@NullVoxPopuli in my case it's in an HBS file, so Glint v1. Not sure if it matters.

boris-petrov avatar Oct 31 '25 17:10 boris-petrov

ah, yes! thank for clarification -- GlintV1 is no longer where I'm spending my Glint time, but I will accept PRs to the v1 branch, here: https://github.com/typed-ember/glint/tree/v1.x

NullVoxPopuli avatar Oct 31 '25 18:10 NullVoxPopuli

I believe this has been fixed with @glint/template 1.7.4. Is that expected, @NullVoxPopuli?

boris-petrov avatar Jan 30 '26 08:01 boris-petrov

ye! thanks for checking in!

NullVoxPopuli avatar Jan 30 '26 15:01 NullVoxPopuli