Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

TypeError: Expected a value of type undefined for result.rent_epoch but received 4. #268

Closed
siddharths067 opened this issue Sep 1, 2019 · 4 comments

Comments

@siddharths067
Copy link

I recently ran the example tictactoe program on the solana net docker image provided.

But it crashes when it starts looking for players in the network.

The BPF program loads successfully and returns the ID as expected.

Connecting to network...
Using http://localhost:8899 (http://localhost:8899)
findDashboard: Expected a value of type `{jsonrpc,id,error} | {jsonrpc,id,error,result}` for `result` but received `{"data":[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"executable":false,"lamports":9997,"owner":[65,163,87,159,4,48,133,107,197,231,226,206,66,25,75,160,182,222,93,219,241,140,68,228,38,10,53,247,9,23,154,146],"rent_epoch":3}`.
Using BPF program
Loading BPF program...
Dashboard programId: 2q41KNuLTKRgwU4qhuEyp4ryyWZAsYpBrFWN4TApwXgU
Dashboard: 6sZki97CtDN3GzzURQwSyKhHYgTsKzdoqDPrPCCYP5Yx
Total games played: 0

Looking for another player
/home/siddharth/Solana/example-tictactoe/node_modules/superstruct/lib/index.js:1194
        throw new StructError(error);
        ^

TypeError: Expected a value of type `undefined` for `result.rent_epoch` but received `4`.
    at Function.Struct.assert.value [as assert] (/home/siddharth/Solana/example-tictactoe/node_modules/superstruct/src/superstruct.js:63:15)
    at Struct (/home/siddharth/Solana/example-tictactoe/node_modules/superstruct/src/superstruct.js:47:21)
    at Connection._wsOnAccountNotification (/home/siddharth/Solana/example-tictactoe/node_modules/@solana/web3.js/src/connection.js:879:17)
    at Client.emit (/home/siddharth/Solana/example-tictactoe/node_modules/rpc-websockets/node_modules/eventemitter3/index.js:181:35)
    at WebSocket.<anonymous> (/home/siddharth/Solana/example-tictactoe/node_modules/rpc-websockets/dist/lib/client.js:424:67)
    at WebSocket.emit (events.js:189:13)
    at WebSocket.EventEmitter.emit (domain.js:441:20)
    at Receiver.receiverOnMessage (/home/siddharth/Solana/example-tictactoe/node_modules/rpc-websockets/node_modules/ws/lib/websocket.js:720:20)
    at Receiver.emit (events.js:189:13)
    at Receiver.EventEmitter.emit (domain.js:441:20)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! tictactoe@0.0.1 start: `babel-node src/cli/main.js "dev"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the tictactoe@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/siddharth/.npm/_logs/2019-09-01T12_46_25_343Z-debug.log

@mvines
Copy link
Member

mvines commented Sep 2, 2019

@siddharths067 - which version of example-tictactoe were you using? This looks like an issue that was fixed in https://github.com/solana-labs/solana-web3.js/releases/tag/v0.18.8 and the latest example-tictactoe should contain this fix

@siddharths067
Copy link
Author

I followed the Solana Getting Started book and I ended up using 0.17.0

@mvines
Copy link
Member

mvines commented Sep 2, 2019

Please use 0.18.0 as that’s the latest release

@jstarry
Copy link
Member

jstarry commented Nov 12, 2019

Stale

@jstarry jstarry closed this as completed Nov 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants