Skip to content

Problem with embedding inside react-markdown due to async / await #123

Open
@simonv3

Description

@simonv3
  • remark-embedder-core version: 3.0.1
  • node version: v16.19.0
  • yarn version: 1.22.19

Relevant code or config

    <ReactMarkdown
        remarkPlugins={[
          remarkGfm,
          [remarkEmbedder, { transformers: [CodeSandboxTransformer] }],
        ]}
      >
        {content}
      </ReactMarkdown>

What you did: I embedded remarkEmbedder in react-markdown.

What happened:

It fails with error:

Uncaught (in promise) Error: `runSync` finished async. Use `run` instead

Problem description:

This happens because react-markdown does not support async plugins.

Suggested solution:

For the basic functionality of remarkEmbedder it doesn't look like it's necessary to do async. Is there a way to set this up so that it's not required?

When I strip the async functionality from the code in my own local copy of index.js it works fine.

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