tinacms: Can't save empty array of blocks

Describe the issue that you’re seeing. Any Loom videos or screenshots usually help a lot!

I cant save empty array of blocks. I think video is enough to understand the problem, but if necessary I can create a demo repo.

https://user-images.githubusercontent.com/86771348/236759289-5cb47aeb-77b0-4e7c-8335-4e840c810139.mov

Reproduction

https://github.com/

Steps to reproduce

I have this field defined:

{
    type: 'object',
    name: 'header',
    label: 'Header',
    list: true,
    ui: {
        component: 'blocks',
    },
    templates: [
        example1,
        example2,
    ],
},

System Info

System:
    OS: macOS 13.3.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 36.08 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 16.18.0 - /opt/homebrew/opt/node@16/bin/node
    Yarn: 1.22.19 - ~/Sites/mbrain/node_modules/.bin/yarn
    npm: 8.19.2 - /opt/homebrew/opt/node@16/bin/npm
    Watchman: 2022.10.10.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 113.0.5672.63
    Firefox: 107.0
    Safari: 16.4

Validations

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 20 (10 by maintainers)

Most upvoted comments

Should be fixed by this when it lands. https://github.com/tinacms/tinacms/pull/4191

@mbrain-io When I say “The monorepo” I am talking about the tinacms monorepo it uses pnpm and turbopack. For testing I created a new folder in the examples folder and then copied all the files from your reproduction into it. After that I changed all the tinacms deps to be “workspace:*”.

Then ran pnpm install and pnpm watchfrom the root. After that (in a new terminal), I changed the directory into the newly created one and ran pnpm dev

@logan-anderson I created new demo project and still having the same issue ☹️

Here it is

Try editing post document, “Field 1” is blocks field. First add several blocks and save. Then try to remove all blocks and save, and after reload old blocks will reappear.

Screenshot 2023-05-19 at 9 03 18 PM

I was able to reproduce it in your repo (Thanks for that 😄 ) but when I copied the same config into the monorepo I could not reproduce. Will take a closer look after the weekend.