Problem
After creating a new Rust contract with create-near-app with latest Rust version 1.70.0, and following the steps to deploy contract, developer failed to view function with near view <dev-account> get_greeting.
This issue is reported by developers in community who are learning how to build on NEAR today.
How to Reproduce
(1) Install the latest Rust version 1.70.0. For example,
stable-x86_64-unknown-linux-gnu (default)
rustc 1.70.0 (90c541806 2023-05-31)
(2) Create a new project with create-near-app command
npx create-near-app my-project --contract rust --frontend none --tests rust
(3) Deploy contract to testnet
cd ./my-project
npm i
npm run deploy
(4) View call function get_greeting
near view <dev-account> get_greeting
View call failed and you'll encounter the error as below.
$ near view dev-1685967486834-62115280035912 get_greeting
View call: dev-1685967486834-62115280035912.get_greeting()
An error occured
Error: Querying [object Object] failed: wasm execution failed with error: CompilationError(PrepareError(Deserialization)).
{
"block_hash": "5cdGPvRvN8JGKs7AfEPjVJaoVZjhhS35H1WgxrvxmNXR",
"block_height": 128323323,
"error": "wasm execution failed with error: CompilationError(PrepareError(Deserialization))",
"logs": []
}
at JsonRpcProvider.query (/usr/local/share/nvm/versions/node/v19.9.0/lib/node_modules/near-cli/node_modules/near-api-js/lib/providers/json-rpc-provider.js:123:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Account.viewFunction (/usr/local/share/nvm/versions/node/v19.9.0/lib/node_modules/near-cli/node_modules/near-api-js/lib/account.js:366:24)
at async exports.callViewFunction (/usr/local/share/nvm/versions/node/v19.9.0/lib/node_modules/near-cli/index.js:103:48)
at async Object.handler (/usr/local/share/nvm/versions/node/v19.9.0/lib/node_modules/near-cli/utils/exit-on-error.js:52:9)
TypedError: Querying [object Object] failed: wasm execution failed with error: CompilationError(PrepareError(Deserialization)).
{
"block_hash": "5cdGPvRvN8JGKs7AfEPjVJaoVZjhhS35H1WgxrvxmNXR",
"block_height": 128323323,
"error": "wasm execution failed with error: CompilationError(PrepareError(Deserialization))",
"logs": []
}
at JsonRpcProvider.query (/usr/local/share/nvm/versions/node/v19.9.0/lib/node_modules/near-cli/node_modules/near-api-js/lib/providers/json-rpc-provider.js:123:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Account.viewFunction (/usr/local/share/nvm/versions/node/v19.9.0/lib/node_modules/near-cli/node_modules/near-api-js/lib/account.js:366:24)
at async exports.callViewFunction (/usr/local/share/nvm/versions/node/v19.9.0/lib/node_modules/near-cli/index.js:103:48)
at async Object.handler (/usr/local/share/nvm/versions/node/v19.9.0/lib/node_modules/near-cli/utils/exit-on-error.js:52:9) {
type: 'UntypedError',
context: undefined
}
Notes
This is probably a compatibility issue of Rust SDK 4.0.0 with Rust 1.70.0.
Problem
After creating a new Rust contract with
create-near-appwith latest Rust version 1.70.0, and following the steps to deploy contract, developer failed to view function withnear view <dev-account> get_greeting.This issue is reported by developers in community who are learning how to build on NEAR today.
How to Reproduce
(1) Install the latest Rust version 1.70.0. For example,
(2) Create a new project with
create-near-appcommand(3) Deploy contract to testnet
cd ./my-project npm i npm run deploy(4) View call function
get_greetingView call failed and you'll encounter the error as below.
Notes
This is probably a compatibility issue of Rust SDK 4.0.0 with Rust 1.70.0.