html-sketchapp: Crash when editing text after importing `.asketch` file
Tried using this project to experiment both with a fork of https://github.com/brainly/html-sketchapp-example/ and this branch of seek-style-guide.
For both those projects, I was able to reproduce crashes with these steps:
- Import an
asketch
file with some text values - Try to either edit a generated text layer or a new text layer
- Sketch crashes
Was able to reproduce in both Sketch stable and beta.
Sketch Stable (47.1) Error Log
Sketch Beta (48) Error Log
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 28 (19 by maintainers)
Commits related to this issue
- fixes #29 — committed to html-sketchapp/html-sketchapp by KimDal-hyeong 7 years ago
- fixes #29 (#31) — committed to html-sketchapp/html-sketchapp by KimDal-hyeong 7 years ago
- Exclude undefined line-height and letter-spacing from JSON Fixes #29 — committed to markdalgleish/html-sketchapp by markdalgleish 7 years ago
- Exclude undefined line-height and letter-spacing from JSON Fixes #29 — committed to markdalgleish/html-sketchapp by markdalgleish 7 years ago
As far as I understand Sketch keeps last used text settings in
${HOME}/Library/Application Support/com.bohemiancoding.sketch3/textStyle-*
. Just remove the file when you need to fix editing.I double checked the code and don’t see where this can be happening 🤔 Hope you’ll be able to debug it @markdalgleish 🤞
Done.
Still working through this, but figured I’d report my progress so far.
It seems that the
undefined
line height and letter spacing values are being turned into nulls at some point. If I change the following line innodeToSketchLayers.js
:to this:
I can see the
12345
value flow through to the JSON instead of null.I’m currently debugging Puppeteer and logging the element whenever the value is
normal
, and they all appear to be buttons and inputs, so just digging into that next.@KimDal-hyeong Bravo!
@markdalgleish I just merged the PR, can you please confirm that it fixes the issue?
BTW I’ve also found a simpler way of “fixing” Sketch after it breaks:
rm "${HOME}/Library/Application Support/com.bohemiancoding.sketch3/textStyle-*"
Which also points to the text styles being the issue.
Thanks for reporting it and creating a test case!
I don’t see such bugs reported in react-sketchapp, so I’m guessing that html-sketchapp is doing something wrong 😕
I’m able to freeze sketch just by opening your file and trying to change text on any of the text layers. To simplify debugging I’ve created a minimal example (no document colors & shared styles, no user settings, and only one symbol consisting of only text layer): minimal.sketch.
(text looks weird because I don’t have your fonts installed locally)
We can try to narrow it down even more and figure out what html-sketchapp might be doing wrong. If that fails, we should contact Sketch devs. I’ll try to take another look this week, but I’ll appreciate any help.
I’ve seen this as well @markdalgleish; the only way for me to fix this is to open up an existing Sketch file that was created before the import of the
asketch
file and copy a text element from there.(@markdalgleish updated issue to have error logs in linked gists)