TypeError: cannot read the properties of undefined (reading 'ProgramType')

Topic discussion checklist

  • the above error message is what i get when i run this command ( ```
    npx fuels typegen -i …/counter-contract/out/debug/*-abi.json -o ./src/contracts)

Hey @alarimoore can you post your Sway contract so I can take a look or were you just simply following the quickstart? I understand you’re doing this for the frontend but i need more information about the versions you are on.

Hi there, @alarimoore

Can you please share the output of “fuelup show”

Please copy and paste since its easier to read than the actual picture.

Thanks! :palm_tree:

1 Like

{
“compilerOptions”: {
“types”: [“@fuel-wallet/sdk”],
“target”: “es5”,
“lib”: [
“dom”,
“dom.iterable”,
“esnext”
],
“allowJs”: true,
“skipLibCheck”: true,
“esModuleInterop”: true,
“allowSyntheticDefaultImports”: true,
“strict”: true,
“forceConsistentCasingInFileNames”: true,
“noFallthroughCasesInSwitch”: true,
“module”: “esnext”,
“moduleResolution”: “node”,
“resolveJsonModule”: true,
“isolatedModules”: true,
“noEmit”: true,
“jsx”: “react-jsx”
},
“include”: [
“src”
]
}

Hi @alarimoore

That’s your tsconfig file, which contains the configuration for the typescript compiler.

However, in this case, we require the information of your toolchain. The reason for this is for us to know which version of the sway compiler is being used to generate your contract’s abi.

To get the information of your current toolchain:

  1. please open a new terminal
  2. write the following prompt
fuelup show
  1. copy and paste the result as a new comment.

Let me know if that works for you!
:palm_tree:

Thank you, I will do that.

Default host: x86_64-unknown-linux-gnu
fuelup home: /home/alarimoore/.fuelup

installed toolchains

Hello sir,
Good day.
I was waiting for your response to my above message.

Hi there!

The information required is under “installed toolchains” and should look something like this.

Default host: x86_64-unknown-linux-gnu
fuelup home: /home/sandusky/.fuelup

installed toolchains
--------------------
latest-x86_64-unknown-linux-gnu
beta-4-x86_64-unknown-linux-gnu (default)

active toolchain
-----------------
beta-4-x86_64-unknown-linux-gnu (default)
  forc : 0.46.1
    - forc-client
      - forc-deploy : 0.46.1
      - forc-run : 0.46.1
    - forc-doc : 0.46.1
    - forc-explore : 0.28.1
    - forc-fmt : 0.46.1
    - forc-index : 0.23.0
    - forc-lsp : 0.46.1
    - forc-tx : 0.46.1
    - forc-wallet : 0.3.0
  fuel-core : 0.20.5
  fuel-core-keygen : Error getting version string
  fuel-indexer : 0.23.0

fuels versions
---------------
forc : 0.45
forc-wallet : 0.45