TinaCMS - Broken documents view in admin sidebar after 2.2.x Update
Hello, I am experiencing an issue with the visual editor after updating to Tina 2.2.0.
I have split my Tina data requests and am using multiple useTina() hooks on my Next.js site. When I enter visual editing mode, my sidebar usually appears like this:
However, in Tina 2.2.0, this "document view" triggers errors. As soon as I try to access the visual edior with /admin#/~, it renders a blank site in browser.
This issue can also be reproduced with the latest tina-cloud-starter after updating to version 2.2.0. Clicking the "home" icon in the sidebar results in the same errors that I'm encountering on my site.
Reproduction
https://github.com/tinacms/tina-cloud-starter
Steps to reproduce
- Install latest tina cloud starter https://github.com/tinacms/tina-cloud-starter
- Update dependecies to Tina 2.2.0 (tinacms: ^2.2.0, @tinacms/cli: ^1.6.0)
- Start Tina in dev mode
- Open http://localhost:3000/admin#/~/posts
- Click on the home icon in the visual editor sidebar
System Info
System: OS: Windows 10 10.0.19045 CPU: (32) x64 AMD Ryzen Threadripper 1950X 16-Core Processor Memory: 18.19 GB / 31.89 GB Binaries: Node: 20.12.2 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD npm: 10.5.0 - C:\Program Files\nodejs\npm.CMD pnpm: 9.7.1 - C:\Program Files\nodejs\pnpm.CMD Browsers: Edge: Chromium (127.0.2651.74) Internet Explorer: 11.0.19041.4355 npmPackages: @tinacms/cli: ^1.6.0 => 1.6.0 tinacms: ^2.2.0 => 2.2.0
Validations
- [x] Follow our Code of Conduct
- [x] Read the docs.
- [x] Check that there isn't already an issue that reports the same bug.
Same. I also get the both of bugs.
- Go to Document View will trugger blank site.
- If not, clicking home icon will trigger blank site too.
For now, I am downgraded tinacms to the previous version.
Yes, updating to the latest version of Tina is not an option at the moment. Due to the bug, the admin section becomes inaccessible. The last working version is 2.1.0. This bug seems to be related to headlessui. Since the Tina team is currently updating dependencies, it might be a good time to update that dependency as well. I hope for a fix soon.
With the version 2.2.0, the issue started to happen to me intermittently when loading the /admin view. Not always. Seems like a race condition. It seems @headlessui/react is updated in some of the repos of Tina, but not in all. Maybe that's how this bug has crept in.
Noticing today that a new version of tinacms released, I tried again updating to see if the bug was resolved but the bug still occured. Out of my curiosity, I tried only downgrade @tinacms/cli to 1.5.52 and...... It works. So, the bug happened because of @tinacms/cli.
Also, the previous commenter mentioned that the bug might happened because of the multiple version of @headlessui/react. So, I tried running npm ls @headlessui/react.
This is the output before I downgraded.
├─┬ @tinacms/[email protected]
│ └─┬ @tinacms/[email protected]
│ ├── @headlessui/[email protected] deduped
│ └─┬ [email protected]
│ └─┬ @graphiql/[email protected]
│ └── @headlessui/[email protected]
└─┬ [email protected]
└── @headlessui/[email protected]
After I downgraded.
├─┬ @tinacms/[email protected]
│ ├─┬ @tinacms/[email protected]
│ │ ├── @headlessui/[email protected]
│ │ ├─┬ [email protected]
│ │ │ └─┬ @graphiql/[email protected]
│ │ │ └── @headlessui/[email protected] deduped
│ │ └─┬ [email protected]
│ │ └── @headlessui/[email protected]
│ └─┬ [email protected]
│ └── @headlessui/[email protected]
└─┬ [email protected]
└── @headlessui/[email protected]
@mddanish00 Thank you for trying it out! I was also considering updating and testing it myself. It's such a pitty – I'm still stuck on version 2.1.0 (which has several high-rated vulnerabilities) due to this issue. Still after weeks and multiple TinaCMS releases, it's really disappointing that it feels like no one from the Tina team is addressing this.
There is a pr up for fixing this issue from Tina Team 😉 #4818 .
That's great news, looking forward to that. Thank you.
Hey all,
Good news the latest release of tinacms has fixed this issue! (Also now clicking the "home" icon takes you back to the collection folder page)
Versions,
[email protected]
@tinacms/[email protected]