deltaDAO / nautilus

The Data Economy TypeScript Toolkit
https://nautilus.delta-dao.com
Apache License 2.0
4 stars 2 forks source link

[Bug] structuredClone is not defined #142

Closed freevedo33 closed 3 months ago

freevedo33 commented 3 months ago

Summary

I am trying to edit an asset using nautilus but it fails with the error

structuredClone is not defined

structuredCloneError

Current Behavior

The AssetBuilder does not work fine I guess. The problem occurs at this step. My code:

import { providers, Wallet } from 'ethers'
import { LogLevel, Nautilus, AssetBuilder } from '@deltadao/nautilus'
import { Request, Response} from 'express'
const provider = new providers.JsonRpcProvider('https://genx.sagresearch.de')
const wallet = new Wallet(process.env.PRIVATE_KEY, provider)
Nautilus.setLogLevel(LogLevel.Verbose)

const customConfig = {
  metadataCacheUri: 'https://aquarius510.v4.delta-dao.com'
}
export async function updateAsset(req: Request, res: Response) {
  const nautilus = await Nautilus.create(wallet, customConfig)

  const result=await nautilus.getAquariusAsset('did:op:ac7543c622f1550fe81fdf8b25b91149c9759e4e4ee5edad78a20631baec6afa')
  console.log(result)
  const assetBuilder = new AssetBuilder(result);
  console.log("assetBuilder", assetBuilder)
 // update asset and return statuscode
}
Abrom8 commented 3 months ago

Which node.js is being used? Please try version 18 or higher.

freevedo33 commented 3 months ago

Which node.js is being used? Please try version 18 or higher.

I was using node 16. Thank you it is working with 18. I forgot to mention it in the issue description