Skip to main content
ArcBlock Community

ToDo list example returns 400

voidmanevoid
Developers
blocklet-serverclosedwont-fix

Hello!

I followed this tutorial:

After creating a DID Space in my wallet for this blocklet which I can see, I received a 400 error when hitting /api/todo-list

javascript
(2024-10-08 12:14:59): Error: GraphQL Status Error 400
(2024-10-08 12:14:59):     at AuthClient._doRequest (/Users/void/Projects/bahnk-money/node_modules/@arcblock/sdk-util/src/index.js:300:11)
(2024-10-08 12:14:59):     at processTicksAndRejections (node:internal/process/task_queues:95:5)
(2024-10-08 12:14:59):     at async queryFn (/Users/void/Projects/bahnk-money/node_modules/@arcblock/sdk-util/src/index.js:149:24)
(2024-10-08 12:14:59):     at async Proxy.<anonymous> (/Users/void/Projects/bahnk-money/node_modules/@blocklet/sdk/lib/service/auth.js:126:29)

any ideas what to do?

4 replies

voidmanevoid23 months ago

this is the code that throws the error:

javascriptCopy
const { user } = await authService.getUser(req.user!.did as string); 

here is req.user

javascriptCopy
(2024-10-08 12:37:21): {
(2024-10-08 12:37:21):   did: 'z1kQnbL2yzEWMsJDBqnL8wCgGAFG8KoKA9i',
(2024-10-08 12:37:21):   role: 'owner',
(2024-10-08 12:37:21):   fullName: 'voidmanevoid',
(2024-10-08 12:37:21):   provider: 'wallet',
(2024-10-08 12:37:21):   walletOS: 'web',
(2024-10-08 12:37:21):   emailVerified: false,
(2024-10-08 12:37:21):   phoneVerified: false,
(2024-10-08 12:37:21):   method: 'loginToken'
(2024-10-08 12:37:21): }
wangshijun23 months ago

Hi, seems the version of @blocklet/sdk used in your blocklet does not match with your blocklet server, please try following to fix:

  • Upgrade @blocklet/sdk to the latest version, should be v1.16.32 at the time of this reply.
  • Upgrade @blocklet/cli to the latest version, with following commands:
    • blocklet server stop -f
    • npm install -g @blocklet/cli
    • blocklet server start

Please let us know if the above steps helped or not.

voidmanevoid23 months ago

thank you ser! that worked and i am now able to use spaces.

Twelve23 months ago

z1e4XATJSo1Y1jom17Uhj1SpKZ4LFmYSaHY welcome to the party!!

z1k7Ks2F6eWNeRWZxwnByDasrHCyLaQQfBG is one of the main arcblock devs. He usually gets back to posts pretty quick, or assigns one of the other devs to help.

I’ll keep my eye out for any response and let you known if I see anything.

Reply