karaxnim/karax

Styles sometimes cause an exception

jfilby opened this issue · 1 comments

Here's an example:

import karax / [karaxdsl, vdom, vstyles]

let vnode =  buildHtml():

  tdiv(style = style((StyleAttr.padding, "1em"),
                     (StyleAttr.margin, "auto"),
                     (StyleAttr.textAlign, "center"),
                     (StyleAttr.width, "25%"))):

    p(): text "Test"

From the exception:

  /Users/x/.nimble/pkgs/karax-1.1.3/karax/vstyles.nim(281)                    style
  /Users/x/.nimble/pkgs/karax-1.1.3/karax/vstyles.nim(260)                    setAttr
  /Users/x/.nimble/pkgs/karax-1.1.3/karax/vstyles.nim(248)                    setAttr
  /usr/local/Cellar/nim/1.4.2/nim/lib/system/fatal.nim(49)                        sysFatal

I know nothing is wrong with the above code, because adding a style (e.g. a border) to the list runs without the exception.

ajusa commented

Hm, I just tired running that example and I didn't get any exceptions. I do notice that you are on 1.1.3 though, I would recommend using 1.2.1 if possible. This is because there was a fix that happened after 1.1.3 was released (#153) that probably fixed this issue. Closing for now, please reopen if you can somehow reproduce this on the latest release of Karax!