Skip to content
This repository was archived by the owner on May 22, 2023. It is now read-only.
This repository was archived by the owner on May 22, 2023. It is now read-only.

Invalid USFM can yield unhelpful errors #25

Description

@RUN-Projects

In importing usfm-editor into a react app, there is a node path error. Am I missing something?

Imported is as follows in react project at 'C:/projects/react-app/':


function Editor() {
  const usfmString = `\\c 1
  \\v 1 This is the first verse.`;
  const setUsfmString = (editedUsfm) => {console.log(editedUsfm)};
  return (
    <UsfmEditor usfmString={usfmString} onChange={setUsfmString}></UsfmEditor>
  );
}

export default Editor;

Initial part of error message:

point
C:/projects/src/interfaces/editor.ts:903
  900 | const node = Node.get(editor, path)
  901 | 
  902 | if (!Text.isText(node)) {
> 903 |   throw new Error(
      | ^  904 |     `Cannot get the ${edge} point in the node at path [${at}] because it has no ${edge} text node.`
  905 |   )
  906 | }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions