lukso-network / lukso-playground

Code snippets to interact with Universal Profiles and other LSP standards
https://docs.lukso.tech/learn/dapp-developer/getting-started
21 stars 19 forks source link

Error running node /create-profile/create-up.js - Error.captureStackTrace(err, this); #15

Closed tantodefi closed 10 months ago

tantodefi commented 10 months ago

After git cloning repo I made me EOA and successfully funded it with "LYXt' but when trying to programatically create-up.js i get the following error:

node:internal/deps/undici/undici:13220
    Error.captureStackTrace(err, this);
          ^

TypeError: RequestInit: duplex option is required when sending a body.
    at Object.fetch (node:internal/deps/undici/undici:13220:11)
    at async Client.fetch (lukso-playground/node_modules/ipfs-utils/src/http.js:129:22)
    at async addAll (lukso-playground/node_modules/ipfs-http-client/src/add-all.js:40:17)
    at async last (lukso-playground/node_modules/it-last/index.js:13:20)
    at async Object.add (lukso-playground/node_modules/ipfs-http-client/src/add.js:23:14)
    at async ipfsUpload (lukso-playground/node_modules/@lukso/lsp-factory.js/build/main/src/lib/helpers/uploader.helper.js:99:12)
    at async UniversalProfile.uploadProfileData (lukso-playground/node_modules/@lukso/lsp-factory.js/build/main/src/lib/classes/universal-profile.js:131:30)
    at async getLsp3ProfileDataUrl (lukso-playground/node_modules/@lukso/lsp-factory.js/build/main/src/lib/services/universal-profile.service.js:140:27)
    at async getEncodedLSP3ProfileData (lukso-playground/node_modules/@lukso/lsp-factory.js/build/main/src/lib/services/universal-profile.service.js:148:38)

Node.js v20.8.0

I did find this however I'm unsure how to go about implement this fix...

Has anyone else ran into this issue? Thanks in advance for your help!

richtera commented 10 months ago

This sounds like a 'method' problem I.e. GET instead of POST

MattPereira commented 10 months ago

I had the same duplex TypeError on node v18.18.2

I think the the @lukso/lsp-factory.js package is incompatible with anything above node v16.x.x

image

image

tantodefi commented 10 months ago

Thanks @MattPereira! This works!