ElementsProject / ElementsProject/libwally-core

Unable to use the library with Common js project

Open
#470 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
307
Forks
159
Avg merge
2h 56m
Merged PRs (30d)
4

Description

I tried using the library as recommened in my CJS project

`If you're using CommonJS, the module can be loaded asynchronously using const wally = await import('wallycore') or import('wallycore').then(wally => { ... }).
`

but i fails with
`require() of ES Module /node_modules/wallycore/src/index.js from .../createLBTCDepositAddress.ts not supported.\nInstead change the require of index.js in ./createLBTCDepositAddress.ts to a dynamic import() which is available in all CommonJS modules.`

I tried using esbuild to import the project as cjs module but it is not able to convert due to
`✘ [ERROR] Top-level await is currently not supported with the "cjs" output format`

Is there a recommended way to use it in the CJS node project, or any example project i can follow. please let me know, thank you!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.