3

Basic project.

Everything was working fine when I was using NPM, but to get asbuild, I had to use yarn. But I started to get the error message in my tsconfig.json file.

Cannot find global type 'CallableFunction'
Cannot find global type 'CallableFunction'

tsconfig.json file

{
"extends": "../node_modules/assemblyscript/std/assembly.json",
"include": [
  "./**/*.ts"
]

}

Here are my dependencies in package.json.

  "devDependencies": {
"asbuild": "^0.2.0",
"assemblyscript": "^0.23.1",
"near-sdk-as": "^3.2.3",
"typescript": "3.1.6"
},

Not sure what is causing this issue.

jcloud
  • 65
  • 5
  • 1
    Your TypeScript version is *severely* out of date and doesn't include the built-in type `CallableFunction`. – kelsny Nov 14 '22 at 21:49
  • I am inferring details from the post; although the original poster is using an outdated typescript version, VSC by default will use bundled typescript for tsserver (which in VSCinsiders is 4.9.3 at the moment). As assemblyscript/std/assembly.json (extended in tsconfig.json) specifies "noLib", CallableFunction/NewableFunction are not defined as they are defined in lib/es5.d.ts in TypeScript. If the posters TS version was relevant there wouldn't be an error as AssemblyScript does not use CallableFunction/NewableFunction in the codebase. – relative Dec 03 '22 at 19:22
  • 2
    Any updates on this ? Facing the same issue on a clean AssemblyScript project (ie. simply running `npx asinit .` creates a folder `assembly` with a `tsconfig.json` that raises this issue) – Oscar Sjöstedt Jan 22 '23 at 12:15
  • 1
    @OscarSjöstedt see here for the solution https://stackoverflow.com/questions/75697581/cannot-find-global-type-callablefunction – UltimaWeapon Apr 13 '23 at 20:02

0 Answers0