Skip to content

Compiled code causes unexpected issues with ESMs #83

@legodude17

Description

@legodude17
  • remark-embedder-core version: 3.0.1
  • node version: 18.4.0
  • npm version: 8.13.0

Relevant code or config

Copied directly from example, except added braces around the remark import.

What you did:
Ran the code.

What happened:
Nothing. The output simply created two <p> tags, rather than the embed.

Problem description:
When doing import remarkEmbedder from '@remark-embedder/core' you actually get an object with a single property: default, which then actually contains the function. When passed to unified, this does nothing. In order to use it, you must instead write remarkEmbedder.default, which is rather counterintuitive.

Suggested solution:
Change the build system to include ESM code, for importing.

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