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

Error when using block inline image in portable text #8795

Open
tine-krueger opened this issue Feb 28, 2025 · 3 comments
Open

Error when using block inline image in portable text #8795

tine-krueger opened this issue Feb 28, 2025 · 3 comments
Assignees

Comments

@tine-krueger
Copy link

Describe the bug

When using sanity image as an inline block element in portable text, as soon as the document is saved, an error is popping up Cannot resolve a DOM node from Slate node

Anyways the image is saved.

To Reproduce

Steps to reproduce the behavior:

  1. use this portable test config
export const portableText = defineType({
	name: 'portableText',
	type: 'array',
	title: 'Content',
	of: [
		{
			type: 'block',
			of: [
				{
					type: 'image',
				},
			],
		},
	],
})
  1. Create a portable text field in a document with an inline image.
  2. Save document

Expected behavior

It should save without this error.

Screenshots

Image

Which versions of Sanity are you using?

@sanity/cli (global)                    3.77.2 (up to date)
@sanity/asset-utils                      2.2.1 (up to date)
@sanity/assist                           3.2.0 (up to date)
@sanity/block-tools                     3.70.0 (up to date)
@sanity/cli                             3.77.2 (up to date)
@sanity/code-input                       5.1.2 (up to date)
@sanity/color-input                      4.0.3 (up to date)
@sanity/cross-dataset-duplicator         1.4.1 (up to date)
@sanity/document-internationalization    3.3.1 (up to date)
@sanity/eslint-config-studio             4.0.0 (latest: 5.0.1)
@sanity/hierarchical-document-list       2.0.0 (up to date)
@sanity/language-filter                  4.0.3 (up to date)
@sanity/preview-url-secret               2.1.4 (up to date)
@sanity/react-loader                   1.10.46 (up to date)
@sanity/schema                          3.77.2 (up to date)
@sanity/table                            1.1.3 (up to date)
@sanity/types                           3.77.2 (up to date)
@sanity/ui                              2.14.3 (up to date)
@sanity/uuid                             3.0.2 (up to date)
@sanity/validation                      3.14.4 (up to date)
@sanity/vision                          3.77.2 (up to date)
@sanity/webhook                          4.0.4 (up to date)
sanity                                  3.77.2 (up to date)

What operating system are you using?
macOS 14.4

Which versions of Node.js / npm are you running?

10.9.2
v22.13.1
@tine-krueger tine-krueger changed the title Error when using block inline image in portable test Error when using block inline image in portable text Feb 28, 2025
@christianhg
Copy link
Member

Hi there! I'm having a little trouble reproducing this so I was wondering if it's possible for you to record a video?

@christianhg christianhg self-assigned this Feb 28, 2025
@tine-krueger
Copy link
Author

Hi @christianhg here you go

Bildschirmaufnahme.2025-02-28.um.15.49.04.mov

But it has nothing to do with saving the document. As soon as I insert an image or any other inline object, the editor looses its view. When I scroll back to it, the error comes.

@christianhg
Copy link
Member

Thank you for this! Looks like it might have to do with Portable Text Inputs in dialogs. I'll see if I can reproduce it that way.

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

2 participants