tldraw / tldraw

SDK for creating whiteboards and canvas experiences on the web.

Home Page:https://tldraw.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Uncaught ValidationError: At instance.insets: Expected an array, got undefined

gempir opened this issue · comments

What happened?

I have canvas on 2.0.0-beta.2

I tried upgrading to 2.0.2 but when I try to start the editor I get this error in the console.

Uncaught ValidationError: At instance.insets: Expected an array, got undefined

The Error seems to happen somewhere here.

super(t?`At ${n}: ${r}`:r),this.rawMessage=e,this.path=t}name="ValidationError"}function s(e,t){try{return t()}catch(t){if(t instanceof o)throw new o(t

azw8I

More specific version:

"@tldraw/tldraw@^2.0.0-beta.2":
  version "2.0.0-beta.2"
  resolved "https://registry.yarnpkg.com/@tldraw/tldraw/-/tldraw-2.0.0-beta.2.tgz#b3760b33f37a5e019dedbdcf574aec481c18531b"
  integrity sha512-gQU7JyTHobWSJ+azcrNRdjpqDknAT+3NGas/9BG9YZc+h2y+uwcy2DaY9FiAEJjQTyS+dSOrm18F6QyOUntY9g==
  dependencies:
    "@radix-ui/react-alert-dialog" "^1.0.0"
    "@radix-ui/react-context-menu" "^2.1.5"
    "@radix-ui/react-dialog" "^1.0.5"
    "@radix-ui/react-dropdown-menu" "^2.0.6"
    "@radix-ui/react-popover" "^1.0.7"
    "@radix-ui/react-select" "^1.2.0"
    "@radix-ui/react-slider" "^1.1.0"
    "@radix-ui/react-toast" "^1.1.1"
    "@tldraw/editor" "2.0.0-beta.2"
    canvas-size "^1.2.6"
    classnames "^2.3.2"
    downscale "^1.0.6"
    hotkeys-js "^3.11.2"
    lz-string "^1.4.4"

How can we reproduce the bug?

I don't have a way to reproduce this bug on my dev environment yet.

If it helps in any way my Project is open source and this is how the editor is setup https://github.com/gempir/gempbot/blob/8c99890a16fcb103dc834e79356dbbbff878c012/web/src/components/Overlay/Editor.tsx

What browsers are you seeing the problem on?

Firefox

Contact Details

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Hey! We added insets prop to TLInstances. It seems to me that your saved data from the previous version would need to be migrated, so that the migrations would run and add the missing property.

You can also manually fix you default_store.ts by adding insets: [false, false, false, false] to 'instance:instance'

Hmm, I understand.

Is there any guide how to migrate data?

I setup the default_store, but I assume it will only apply to new elements, because I still get the error with this extended default_store.

loadSnapshot should migrate the data, so my guess is that there's some issue with schema.

We are just doing some work on migrations and we'll have more docs soon.