跳到主要内容

React Dependency Error

JustHODL Dev
开发者
blocklet-server

I'm using NextJS to build a listing site. I ran into this error: ⨯ ./node_modules/@arcblock/did-connect/lib/OAuth/space.js:3

Module not found: Can't resolve '@blocklet/js-sdk'

1 | import axios from 'axios';

2 | import { joinURL } from 'ufo';

> 3 | import { getCSRFToken } from '@blocklet/js-sdk';

| ^

4 | import { DID_SPACES_DID } from '../env';

5 |

6 | /* eslint-disable import/prefer-default-export */

When using the arcblock DID Connect module. Any info on this would be appreciated. I am also using legacy dependencies because some of the arcblock dependencies were not compatible with the most recent version of React.

5 条回复

wangshijun22个月前

Hi, you just need to add @blocklet/js-sdk to your blocklet, since it's a peer dependency.

JustHODL Dev22个月前

Hi we don't plan to launch a blocklet on the blocklet store. We are simply using the DID Connect React library for authentication as well as the payment kit. Perhaps I am looking at this the wrong way and if so could you direct me to the appropriate documentation?

JustHODL22个月前

@void mane void do you know how?

voidmanevoid22个月前

have you tried:

npm install @blocklet/js-sdk

it's a publicly available package so that might work.

wangshijun22个月前

You can always build your blocklet and choose not to publish to anywhere, just hosting it on your server.

But you can use anything we provide when you are building the blocklet.

回复