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: Cannot resolve a DOM node from Slate node when using plugin with default config #16

Open
tomasmazzocchi opened this issue Sep 21, 2023 · 9 comments

Comments

@tomasmazzocchi
Copy link

tomasmazzocchi commented Sep 21, 2023

Background

I am trying to use this plugin because fits my requirements but when I added it to my schema and then tried to create a table in the Desk Sanity Studio I got this error after clicking to activate a cell

Error

image image

Config

Screenshot 2023-09-21 at 15 29 13 image
@davydog187
Copy link
Owner

@tomasmazzocchi I don't actively maintain this library, but I'm happy to review and merge PRs. Would you be interested in sending one?

@leads
Copy link

leads commented Nov 29, 2023

Same issue here. The error occurs after I have added rows/cells and try to activate one in order to type in it.
Ssanity v3.19.2

@davydog187
Copy link
Owner

@leads if you are interested in fixing the issue, I am would be happy to review your PR

@alexgorgos
Copy link
Contributor

alexgorgos commented Feb 14, 2024

add

renderBlock={props.renderBlock}
renderAnnotation={props.renderAnnotation}

props in TableInput.tsx for the MemberField component.

{rowsMember && (
	<MemberField
		member={rowsMember}
		renderInput={rowsInput}
		renderField={props.renderField}
		renderItem={props.renderItem}
		renderPreview={props.renderPreview}
		renderBlock={props.renderBlock}
		renderAnnotation={props.renderAnnotation}
	/>
)}

That should fix it

@giuseppe-hex
Copy link

@davydog187 Is it possible to get the NPM version of this updated?

@davydog187
Copy link
Owner

Yep, on it

@davydog187
Copy link
Owner

I tried to get a version out, but typescript is throwing a bunch of errors.

npx tsc
node_modules/@sanity/types/lib/dts/src/index.d.ts:756:3 - error TS1139: Type parameter declaration expected.

756   const TType extends string | IntrinsicTypeName, // IntrinsicTypeName here improves autocompletion in _some_ IDEs (not VS Code atm)
      ~~~~~

node_modules/@sanity/types/lib/dts/src/index.d.ts:756:15 - error TS1005: ',' expected.

756   const TType extends string | IntrinsicTypeName, // IntrinsicTypeName here improves autocompletion in _some_ IDEs (not VS Code atm)
                  ~~~~~~~

node_modules/@sanity/types/lib/dts/src/index.d.ts:756:30 - error TS1005: ',' expected.

756   const TType extends string | IntrinsicTypeName, // IntrinsicTypeName here improves autocompletion in _some_ IDEs (not VS Code atm)
                                 ~

node_modules/@sanity/types/lib/dts/src/index.d.ts:757:3 - error TS1109: Expression expected.

I don't have time to debug this, so if someone can provide guidance I can fix. Otherwise I will not be able to get a new version out

@Addibro
Copy link

Addibro commented May 24, 2024

Hey, getting the same issue, but before that I get this:

image

I have this in my config:

    portableTable({
      name: 'richTable',
      title: 'Rich Table',
      cellSchema: {
        title: 'Block',
        type: 'block',
        styles,
      }
    }),

@davydog187
Copy link
Owner

PRs are welcome to fix the issue. I'm happy to review and release new versions. I do not have the capacity to triage and fix myself as I am no longer a user of Sanity

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

6 participants