TypeError: Cannot assign to read only property ‘Symbol(Symbol.toStringTag)’ of object ‘#’ Helia error on nextJS. await createHelia() initialize libp2p RandomWalk error

Hi there!,
I’m just trying to do a basic setup with Helia in NextJS and I’m getting an RandomWalk error on initialization. I haven’t found anything related online.
so:

import { createHelia } from 'helia';

     try {
      const helia = await createHelia()
    }  catch (error) {
      console.error('Error uploading file to IPFS:', error);
    }

error returns:
DashboardTabs.tsx:21 Error uploading file to IPFS: TypeError: Cannot assign to read only property ‘Symbol(Symbol.toStringTag)’ of object ‘#’

 at new RandomWalk (random-walk.js:119:20)
    at new Libp2pNode (libp2p.js:328:47)
    at createLibp2pNode (libp2p.js:396:12)
    at async createLibp2p (index.js:48:18)
    at async createLibp2p (libp2p.js:40:18)
    at async createHelia (index.js:57:18)
    at async uploadToIPFS (DashboardTabs.tsx:19:21)

Before using Helia I was using ipfs-http-client, I had a big error in production and found out it was deprecated so I decided to go with Helia. I just wanted to upload a image to IPFS and get the CID. That’s it, just a basic implementation, Any advice would be appreciated!. :grin:

Helia is a full IPFS implementation, not a client for an HTTP API like ipfs-http-client is.

If you’re trying to upload the image to a Kubo node running somewhere else you should use kubo-rpc-client - it’s a drop-in replacement for ipfs-http-client.

As to your error - Cannot assign to read only property ‘Symbol(Symbol.toStringTag)’ of object ‘#’. A quick search seems to show it happens when using Jest on old node versions.

Can you confirm if this is happening in prod for you or during tests?

If it’s tests, what version of node.js you are using?