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

HtmlReactPlugin serialize error: Cannot resolve a DOM point from Slate point: {"path":[0,0],"offset":1} #3553

Open
carlos19960601 opened this issue Sep 20, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@carlos19960601
Copy link

carlos19960601 commented Sep 20, 2024

Description

I Follow the doc and create a basic editor. Calling htmlReact.serialize causes a error: Cannot resolve a DOM point from Slate point: {"path":[0,0],"offset":1}

import {
  Plate,
  PlateContent,
  usePlateEditor,
} from "@udecode/plate-common/react";

import { HtmlReactPlugin } from "@udecode/plate-html/react";

const PlateEditor = () => {
  const editor = usePlateEditor({
    plugins: [HtmlReactPlugin],
  });
  return (
    <Plate
      editor={editor}
      onChange={({ value }) => {
        const html = editor.api.htmlReact.serialize({
          nodes: editor.children,
        });
        console.log(value, html);
      }}
    >
      <PlateContent placeholder="Type..." />
    </Plate>
  );
};

Reproduction URL

No response

Reproduction steps

just basic editor with HtmlReactPlugin

Plate version

38.0.4

Slate React version

0.110.1

Screenshots

No response

Logs

No response

Browsers

Chrome

Funding

  • You can sponsor this specific effort via a Polar.sh pledge below
  • We receive the pledge once the issue is completed & verified
Fund with Polar
@carlos19960601 carlos19960601 added the bug Something isn't working label Sep 20, 2024
@mrhirapra
Copy link

mrhirapra commented Sep 27, 2024

I'm also facing this problem. I'm find many ways but still not any solution 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants