[Bug]: Copy-pasting from tldraw.com to the file using VSCode Plugin produces empty `"records"` field
What happened?
- Create a diagram on tldraw.com
- Install the VSCode plugin for Tldraw
- Create an empty file called
something.tldr, opening it shows an empty drawing - Copy-paste a diagram from tldraw.com into the VSCode plugin
- The diagram shows up in editor but the file have an empty
"records"field
To fix:
- Simply edit anything in the diagram and then save.
How can we reproduce the bug?
See steps above ^
What browsers are you seeing the problem on?
Chrome
Contact Details
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Hey! Could you please try this again and let us know if you still see it? I'm suspecting the website and the VS Code were not on the same version when that happened.
Works even worse now... Can't even open a new empty file.
What happened?
- Install the VSCode plugin for Tldraw
- Create an empty file called something.tldr, opening it and it crashes...
Can you tell us a bit more:
- What version of the extension are you using?
- What's your VS Code version?
I tried it on VS Code Version: 1.91.1 and tldraw v2.12.0 and it does seem to work for me, so it must be some difference in our environments.
https://github.com/user-attachments/assets/fedd370e-0351-407f-b1de-742b685dd330
Restarted VSCode and it now shows an empty file again. So might have been a version problem. But my original reported problem seems to persist:
tldraw extension v2.12.0
You definitely need to save the document for the change to persist to the file, it's the same as with regular text files - just pasting won't persist it on disk. That said, just pasting should mark the file as dirty. When I paste I get this dot notifying me that I have unsaved changes in the file. Does this not happen to you? Does it only appear after making another change?
Not getting any dot.
https://github.com/user-attachments/assets/a64e465c-cb0b-43fe-b861-4dabc9854859
Thanks for the info, will investigate. Seems like the dirty tracking is not working as it should in this case.
We just released a new pre release version that should fix this issue. Could you give it a try and let me know if it now works?
To install a prerelease version you can go to the extension manager, select tldraw, then click the switch to prerelease: