Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: structuredClone is not defined #1161

Closed
FossilFrank opened this issue Aug 2, 2023 · 5 comments
Closed

Bug: structuredClone is not defined #1161

FossilFrank opened this issue Aug 2, 2023 · 5 comments
Labels

Comments

@FossilFrank
Copy link

FossilFrank commented Aug 2, 2023

What version of fuels-ts are you using?

0.49.1

Steps to Reproduce

I'm running a simple script:

import { Provider } from "fuels";
import { RegistryContractAbi__factory } from "./contracts";

(async function() {
  const provider = new Provider('http://127.0.0.1:4000/graphql');

  const registry = RegistryContractAbi__factory.connect(String(process.env.REACT_APP_REGISTRY_CONTRACT_ID), provider);

  const vault = await registry.functions.vault().get();
  console.log({ vault });
})();

Expected Behavior

Call the function

Actual Behavior

node_modules/@fuel-ts/abi-coder/dist/index.js:677
        o[typeParameter] = structuredClone(arg.typeArguments?.[typeParameterIndex]);
          ^

ReferenceError: structuredClone is not defined
    at <anonymous> (node_modules/@fuel-ts/abi-coder/dist/index.js:677:11)
    at Array.reduce (<anonymous>)
    at Function.resolveGenericComponents (node_modules/@fuel-ts/abi-coder/dist/index.js:674:62)
    at Function.getArgSignatureContent (node_modules/@fuel-ts/abi-coder/dist/index.js:834:27)
    at Function.getArgSignature (node_modules/@fuel-ts/abi-coder/dist/index.js:806:26)
    at Function.getArgSignatureContent (node_modules/@fuel-ts/abi-coder/dist/index.js:837:23)
    at Function.getArgSignature (node_modules/@fuel-ts/abi-coder/dist/index.js:806:26)
    at <anonymous> (node_modules/@fuel-ts/abi-coder/dist/index.js:840:66)
    at Array.map (<anonymous>)
    at Function.getArgSignatureContent (node_modules/@fuel-ts/abi-coder/dist/index.js:840:48
@FossilFrank FossilFrank added the bug label Aug 2, 2023
@arboleya
Copy link
Member

arboleya commented Aug 2, 2023

cc @nedsalk

@rtomas
Copy link

rtomas commented Aug 2, 2023

same problem here with a very single app in next.js

@arboleya
Copy link
Member

arboleya commented Aug 3, 2023

@FossilFrank @rtomas It seems you are using NodeJS < 17, is that right? (docs)

Could you please try again with a newer version and report back?

@FossilFrank
Copy link
Author

Correct, I'm using Node 16, I'll try updating it later

@nedsalk
Copy link
Contributor

nedsalk commented Sep 11, 2023

Given that v16 has reached EOL, this issue has become obsolete, as we plan on officially supporting only the latest two LTS versions, per internal discussions. Support for v20 is tracked in #1104, and v18 is used by the repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants