thorswap / SwapKit

SwapKit SDK - Integrate blockchains easily. Docs - https://docs.thorswap.finance/swapkit-docs
https://swapkit.dev
Apache License 2.0
53 stars 28 forks source link

SyntaxError while integrated with nuxt js 3 #903

Closed HelloRWA closed 2 months ago

HelloRWA commented 3 months ago

Current behavior

It shows the error:

  SyntaxError: The requested module '@psf/bitcoincashjs-lib' does not provide an export named 'TransactionBuilder'
  at ModuleJob._instantiate (node:internal/modules/esm/module_job:131:21)
  at async ModuleJob.run (node:internal/modules/esm/module_job:213:5)
  at async ModuleLoader.import (node:internal/modules/esm/loader:308:24)
  at async ViteNodeRunner.interopedImport (node_modules/.pnpm/vite-node@1.4.0/node_modules/vite-node/dist/client.mjs:383:28)
  at async ViteNodeRunner.directRequest (node_modules/.pnpm/vite-node@1.4.0/node_modules/vite-node/dist/client.mjs:253:24)
  at async ViteNodeRunner.cachedRequest (node_modules/.pnpm/vite-node@1.4.0/node_modules/vite-node/dist/client.mjs:189:14)
  at async ViteNodeRunner.dependencyRequest (node_modules/.pnpm/vite-node@1.4.0/node_modules/vite-node/dist/client.mjs:233:12)
  at async node_modules/.pnpm/@swapkit+sdk@1.0.2_@babel+core@7.24.3_@polkadot+util-crypto@12.6.2_fastestsmallesttextencoder_wvhcu6wkucfh3vpswcidayh6xy/node_modules/@swapkit/sdk/dist/index.js:1:31
  at async ViteNodeRunner.runModule (node_modules/.pnpm/vite-node@1.4.0/node_modules/vite-node/dist/client.mjs:362:5)
  at async ViteNodeRunner.directRequest (node_modules/.pnpm/vite-node@1.4.0/node_modules/vite-node/dist/client.mjs:346:5)

Expected behavior

should not have error

Functionality

Packages

Details

Package versions:

# Paste the output of `<npm|yarn|pnpm|bun pm> ls --depth=0 | grep @swapkit` here
pnpm ls --depth=0 |grep @swapkit
@swapkit/sdk 1.0.2
ice-chillios commented 2 months ago

@HelloRWA workaround for that would be to create .d.ts file, add:

declare module "@psf/bitcoincashjs-lib";

and include it in your tsconfig.json for now as @psf/bitcoincashjs-lib is outside of our possibility to fix and we are right now looking for some solution to replace.