solana-labs / example-tictactoe

Tic-Tac-Toe built on Solana
https://solana-example-tictactoe.herokuapp.com/
MIT License
37 stars 36 forks source link

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

Closed siddharths067 closed 4 years ago

siddharths067 commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

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

mvines commented 5 years ago

Please use 0.18.0 as that’s the latest release

jstarry commented 4 years ago

Stale