AstarNetwork / astar.js

Astar network Typescript SDK
Apache License 2.0
30 stars 9 forks source link

Module not found: Can't resolve imported dependency "@astar-network/astar-api" #7

Closed sirius651 closed 2 years ago

sirius651 commented 2 years ago

Describe the bug when I try to use import { options } from '@astar-network/astar-api';, it causes

Module not found: Can't resolve imported dependency "@astar-network/astar-api"
drewstone commented 2 years ago

Can you provide details on your setup and steps to reproduce?

drewstone commented 2 years ago

As far as I know @sirius651, the examples work with this type of dependency so it might be an issue with your tsconfig.json.

https://github.com/webb-tools/astar.js/blob/main/examples/index.ts

sirius651 commented 2 years ago

@drewstone I just installed as yarn add @astar-network/astar-api , then add import { options } from '@astar-network/astar-api';. here's our tsconfig.json: https://github.com/AstarNetwork/astar-apps/blob/main/tsconfig.json
What parameters should we put in to match compatibility? other third party library works smoothly without custom config though

sirius651 commented 2 years ago

@drewstone Hello, any news for this?

drewstone commented 2 years ago

We will have @sushi30 look into this and fix it up.

sushi30 commented 2 years ago

Hi. I updated the npm package. Please try reinstalling using the command in the README. Not that you might have to reinstall astar-api

yarn up @astar-network/astar-api@beta
sirius651 commented 2 years ago

Thanks, it works now