Thinkmill / keystatic

First class CMS experience, TypeScript API, Markdown & YAML/JSON based, no DB
https://keystatic.com
MIT License
1.22k stars 80 forks source link

Document editor crashes on large documents with   characters #653

Open fezproof opened 1 year ago

fezproof commented 1 year ago

Description

The keystatic website will crash my tab whenever a make an edit to a large document fields or save a particularly large one. This seems to be caused by memory leaks.

There are no errors printed to the browser console or terminal. The page will just error out.

https://github.com/Thinkmill/keystatic/assets/26830309/f5b04d95-40bb-45fa-98b4-debe8d68c726

Specs

Running on the astro runtime just locally using the local storage option. @keystatic/core 0.1.5 @keystatic/astro 1.0.2

fezproof commented 1 year ago

Ok so I did some experiments and it seems to be related to content fields containing the   character. If there are too many it will crash

JedWatson commented 1 year ago

Interesting, I haven't seen this before but it sounds like something we can look into.

@fezproof can you share the source code for a document (including a lot of &nbsp) that causes the issue for you so we can try and reproduce it? feel free to link to a file or a gist rather than pasting a large document here

fezproof commented 1 year ago

Does this make sense? Happy to clarify anything. Sorry for all the Pathfinder jargon https://gist.github.com/fezproof/258fe62357e8892515f7e5531ce31232