Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy/Paste Feature: "Invalid clipboard item - Referenced document does not exist" when copying sections with references #8142

Open
milewskibogumil opened this issue Dec 27, 2024 · 0 comments

Comments

@milewskibogumil
Copy link

Bug: Copy/Paste Feature Fails for Referenced Fields Collections

Describe the bug
The new copy/paste feature for schemas fails when trying to copy sections containing referenced fields, specifically when the reference is a collection of items (like FAQs). The error occurs even though the referenced documents exist in the dataset.

To Reproduce

  1. Create a section with referenced fields (e.g., FAQ section referencing a collection of FAQ items)
  2. Try to copy the section using the new copy/paste feature
  3. Attempt to paste the section
  4. Receive error toast: "Invalid clipboard item. The referenced document '[ID]' does not exist"

Expected behavior
The section should copy and paste successfully, maintaining the references to the existing FAQ items.

Error Screenshot
Screenshot 2024-12-27 at 1 02 12 PM

Sanity Versions

@sanity/cli (global)                   3.54.0 (latest: 3.68.3)
@sanity/document-internationalization   3.3.0 (up to date)
@sanity/eslint-config-studio            5.0.1 (up to date)
@sanity/vision                         3.68.3 (up to date)
sanity                                 3.68.3 (up to date)

Additional context

  • Verified through Vision tab with GROQ that the referenced document IDs exist in the dataset
  • Current workaround: None identified

Environment:

  • Node.js version: v21.4.0
  • bun version: 1.1.26
  • OS: macOS Sequoia (Version 15.1.1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant