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

indent.html does not exist when using es modules #19

Open
Pomax opened this issue Aug 11, 2020 · 3 comments
Open

indent.html does not exist when using es modules #19

Pomax opened this issue Aug 11, 2020 · 3 comments

Comments

@Pomax
Copy link

Pomax commented Aug 11, 2020

running this in node 14:

import indent from "indent";

export default async function processfile(data) {
  return indent.html(data);
}

errors out going

(node:6724) UnhandledPromiseRejectionWarning: TypeError: indent.html is not a function
    at ....

So that's literally useless? =(

@dwjohnston
Copy link

You need to import

import { indent} from "indent";

@Pomax
Copy link
Author

Pomax commented Dec 23, 2020

@zebzhao can you update the README with that? Right now it's telling folks to use the wrong import:

image

@aral
Copy link

aral commented Mar 17, 2023

This appears to be fixed in that import indent from 'indent.js' works and import { indent } … results in undefined now.

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

3 participants