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

Failed to import - html-to-react #118

Closed
majo44 opened this issue Sep 8, 2021 · 1 comment
Closed

Failed to import - html-to-react #118

majo44 opened this issue Sep 8, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@majo44
Copy link

majo44 commented Sep 8, 2021

Failing module

import { Parser } from 'https://esm.sh/html-to-react@1.4.5?dev';
const parser = new Parser();
parser.parse('<div><h1>Title</h1><p>A paragraph</p></div>');

Error message

After running deno run I get this:

error: Uncaught TypeError: DomHandler is not a constructor
        var handler = new DomHandler();
                      ^
    at parseHtmlToTree (https://cdn.esm.sh/v48/html-to-react@1.4.5/deno/html-to-react.development.js:635:23)
    at parseWithInstructions (https://cdn.esm.sh/v48/html-to-react@1.4.5/deno/html-to-react.development.js:675:23)
    at Object.parse (https://cdn.esm.sh/v48/html-to-react@1.4.5/deno/html-to-react.development.js:684:16)
    at file:///C:/projects/prv/esm-sh-bugs/test.ts:3:8

Additional info

Compiled version of html-to-react contains import __domhandler$ from "/v48/domhandler@3.3.0/deno/domhandler.development.js";
but domhandler has custom default export https://github.com/fb55/domhandler/blob/master/src/index.ts#L238

  • esm.sh version: v48
  • Deno version: 1.13.2
@majo44 majo44 added the bug Something isn't working label Sep 8, 2021
@ije
Copy link
Member

ije commented Sep 8, 2021

@majo44 thanks, i will look into it 🙏

@ije ije closed this as completed in 4d139ef Sep 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants