You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Error is thrown in build time inside near-sdk-core package."
Error Message
ERROR TS2304: Cannot find name 'encode'.
this.setBytes(key, encode<T>(value));
in ~lib/near-sdk-core/storage.ts(158,26)
ERROR TS2304: Cannot find name 'decode'.
return decode<T>(bytes);
in ~lib/near-sdk-core/util.ts(46,12)
"While inspecting further, I can see that encode and decode functions are defined inside near-sdk-core\assembly\as_types.d.ts and cannot figure out where is the problem. I've tried updating near-sdk-core and typescript compiler to latest version to latest version but it did not make any difference."
Replicated Locally
yarn build:as
yarn run v1.22.5
$ ./contracts/assemblyscript/build.js
compiling contract [ nep21-basic/main.ts ] to [ out/nep21-basic-as.wasm ]
asconfig.js is deprecated use `asb`to build files. NOTE: output now in ./build/release/
asc /Users/jlwaugh/Desktop/FT/contracts/assemblyscript/nep21-basic/main.ts -O3z --debug --measure --runPasses inlining-optimizing,dce --optimizeLevel 3 --shrinkLevel 3 --target release --binaryFile build/release/main.wasm
ERROR TS2304: Cannot find name 'encode'.
this.setBytes(key, encode<T>(value));
~~~~~~
in ~lib/near-sdk-core/storage.ts(158,26)
ERROR TS2304: Cannot find name 'decode'.
return decode<T>(bytes);
~~~~~~
in ~lib/near-sdk-core/util.ts(46,12)
/Users/jlwaugh/Desktop/FT/node_modules/near-sdk-bindgen/compiler.js:19
throw new Error(err);
^
Error: Error: 2 compile error(s)
at cb (/Users/jlwaugh/Desktop/FT/node_modules/near-sdk-bindgen/compiler.js:19:15)
at Object.main (/Users/jlwaugh/Desktop/FT/node_modules/assemblyscript/cli/asc.js:717:12)
at compileProject (/Users/jlwaugh/Desktop/FT/node_modules/asbuild/dist/cli.js:191:9)
at main (/Users/jlwaugh/Desktop/FT/node_modules/asbuild/dist/cli.js:92:9)
at module.exports.compile (/Users/jlwaugh/Desktop/FT/node_modules/near-sdk-bindgen/compiler.js:42:3)
at compileContract (/Users/jlwaugh/Desktop/FT/contracts/assemblyscript/build.js:23:3)
at Array.map (<anonymous>)
at Object.<anonymous> (/Users/jlwaugh/Desktop/FT/contracts/assemblyscript/build.js:6:16)
at Module._compile (internal/modules/cjs/loader.js:1015:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The text was updated successfully, but these errors were encountered:
via km1tz on Discord:
"Error is thrown in build time inside near-sdk-core package."
Error Message
"While inspecting further, I can see that encode and decode functions are defined inside near-sdk-core\assembly\as_types.d.ts and cannot figure out where is the problem. I've tried updating near-sdk-core and typescript compiler to latest version to latest version but it did not make any difference."
Replicated Locally
The text was updated successfully, but these errors were encountered: