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

Compiled code causes unexpected issues with ESMs #83

Open
legodude17 opened this issue Oct 12, 2022 · 1 comment
Open

Compiled code causes unexpected issues with ESMs #83

legodude17 opened this issue Oct 12, 2022 · 1 comment

Comments

@legodude17
Copy link

  • 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.

@TomerAberbach
Copy link

Running into the same issue. I think the solution would be to either expose an ESM entry point or maybe different type definitions somehow? Not sure exactly

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

2 participants