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

Unable to import module in Typescript #22

Open
krishnaTORQUE opened this issue Feb 26, 2022 · 3 comments
Open

Unable to import module in Typescript #22

krishnaTORQUE opened this issue Feb 26, 2022 · 3 comments

Comments

@krishnaTORQUE
Copy link

Error
Error [ERR_REQUIRE_ESM]: require() of ES Module

Code
import {convert} from 'cashify';

const { convert }: any = await import('cashify');

const convert: any = (await import('cashify')).convert;

None of those examples above working.

Is there anyone facing this issue ?

@xxczaki
Copy link
Member

xxczaki commented Feb 26, 2022

@krishnaTORQUE
Copy link
Author

Please see https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

Hi
Thank you but this doc tells to convert into ESM which I dont want at this moment.
I am just dynamically importing the cashify module but it does not work. is there any other way ?

@d2xdt2
Copy link

d2xdt2 commented Sep 15, 2022

@krishnaTORQUE I am maintaining an ES2017 fork of this package at https://www.npmjs.com/package/cashify-es2017 , which means it can be used as any other package.

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