Cannot add to ipsf

hi, I am using this code to try to add a simple file to ipfs… but i am method is just stuck on await call and gives an error “cannot fetch”
link to my code here.

Hi @nuel77

Could you please share with me a screenshot of the error you’re encountering?

I have run the same code and it seems that I’m receiving a hash for the file I’m uploading.

here is the error i am getting…


Error uploading file:  
TypeError: Failed to fetch
    at fetchCallImpl (https://gc.kis.v2.scr.kaspersky-labs.com/FD126C42-EBFA-4E12-B309-BB3FDD723AC1/main.js?attr=UZYQ9mf8IojE15qvKfecWwwSCWGD3a9ML_cohZUBslUkdhI3EvJi7KHcznnPgO6a:2671:25)

    at window.fetch (https://gc.kis.v2.scr.kaspersky-labs.com/FD126C42-EBFA-4E12-B309-BB3FDD723AC1/main.js?attr=UZYQ9mf8IojE15qvKfecWwwSCWGD3a9ML_cohZUBslUkdhI3EvJi7KHcznnPgO6a:2673:55)

    at fetchWith (https://cjno2i.csb.app/node_modules/ipfs-utils/src/http/fetch.browser.js:106:7)

    at Client.fetch (https://cjno2i.csb.app/node_modules/ipfs-utils/src/http.js:129:7)

    at Client.fetch (https://cjno2i.csb.app/node_modules/ipfs-http-client/esm/src/lib/core.js:141:20)

    at Client.post (https://cjno2i.csb.app/node_modules/ipfs-utils/src/http.js:171:17)

    at addAll (https://cjno2i.csb.app/node_modules/ipfs-http-client/esm/src/add-all.js:18:27)

    at async last (https://cjno2i.csb.app/node_modules/it-last/index.js:13:20)

    at async Object.add (https://cjno2i.csb.app/node_modules/ipfs-http-client/esm/src/add.js:16:14)

    at async onChange (https://cjno2i.csb.app/src/App.js:36:21)