Skip to main content

React Dependency Error

JustHODL Dev
Developers
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 replies

wangshijun22 months ago

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

JustHODL Dev22 months ago

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 months ago

@void mane void do you know how?

voidmanevoid22 months ago

have you tried:

npm install @blocklet/js-sdk

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

wangshijun22 months ago

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.

Reply