Currently, I am attempting to retrieve balances from Binance within my NextJS 13 application, utilizing the /src/app
directory along with TypeScript.
async function fetchData() {
const exchange = new ccxt.binance ({
"apiKey": "mykey",
"secret": "mysecret",
})
return exchange.fetchTotalBalance()
}
export default async function Page() {
const info = await getData()
return <main>{info. Total}</main>
}
Unfortunately, an error keeps appearing:
Error [ERR_MODULE_NOT_FOUND]: Cannot locate module 'D:\myapp\.next\server\static_dependencies\node-fetch\index.js' that is being imported from D:\myapp\.next\server\app\page.js
I have tried installing and importing the node-fetch package but it did not resolve the issue. Information on using ccxt with React/NextJS is limited, so any assistance would be greatly appreciated.