remarkjs / remark-rehype

plugin that turns markdown into HTML to support rehype
https://remark.js.org
MIT License
258 stars 18 forks source link

Unable to import remark-rehype in a Deno project #26

Closed dwoznicki closed 2 years ago

dwoznicki commented 2 years ago

Initial checklist

Affected packages and versions

10.1.0

Link to runnable example

No response

Steps to reproduce

I have an index.ts file with the following content.

import remarkRehype from "https://esm.sh/remark-rehype@10";

When I run this file with

deno run index.ts

I get the following errors.

error: TS2671 [ERROR]: Cannot augment module 'hast' because it resolves to a non-module entity.
declare module 'hast' {
               ~~~~~~
    at https://esm.sh/v92/mdast-util-to-hast@12.2.0/complex-types.d.ts:7:16

TS2694 [ERROR]: Namespace '__' has no exported member 'Options'.
      (import('https://esm.sh/v92/mdast-util-to-hast@12.2.0/lib/index.d.ts').Options | undefined)?
                                                                             ~~~~~~~
    at https://esm.sh/v92/remark-rehype@10.1.0/lib/index.d.ts:33:78

TS2694 [ERROR]: Namespace '__' has no exported member 'Options'.
  | [null | undefined, (import('https://esm.sh/v92/mdast-util-to-hast@12.2.0/lib/index.d.ts').Options | undefined)?]
                                                                                              ~~~~~~~
    at https://esm.sh/v92/remark-rehype@10.1.0/lib/index.d.ts:35:95

TS2694 [ERROR]: Namespace '__' has no exported member 'Options'.
  | [import('https://esm.sh/v92/mdast-util-to-hast@12.2.0/lib/index.d.ts').Options]
                                                                           ~~~~~~~
    at https://esm.sh/v92/remark-rehype@10.1.0/lib/index.d.ts:36:76

Found 4 errors.

Here is the output of deno --version for me.

deno 1.19.1 (release, x86_64-apple-darwin)
v8 9.9.115.7
typescript 4.5.2

Expected behavior

I'd expect to be able to import and run remark-rehype in a Deno project.

Actual behavior

I cannot use this module due to the errors noted above.

Runtime

Deno

Package manager

No response

OS

macOS

Build and bundle tools

No response

wooorm commented 2 years ago

I don’t get any errors:

$ deno --version
deno 1.23.3 (release, x86_64-apple-darwin)
v8 10.4.132.8
typescript 4.7.4
github-actions[bot] commented 2 years ago

Hi! Thanks for taking the time to contribute! This has been marked by a maintainer as needing a reproduction: It’s not yet clear whether this is a problem. Here are a couple tips:

Thanks, — bb

dwoznicki commented 2 years ago

Ahh, yeah, I just upgraded Deno versions and the error is gone. Nice! There must have been an issue in that version of Deno.

github-actions[bot] commented 2 years ago

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.