onflow / flow-playground

Flow Playground front-end app 🤹‍♂️
https://play.flow.com
Apache License 2.0
116 stars 26 forks source link

The playground isn't running the Capability Tutorial Correctly #818

Open flow-slack-issue-bot[bot] opened 2 weeks ago

flow-slack-issue-bot[bot] commented 2 weeks ago

Reported by: Brian Doyle (<@brian.doyle>)

Issue Description:

This may be related to the log issue I created: Attempt the tutorial here: https://cadence-lang.org/docs/tutorial/capabilities

The Create Link tx appears to do nothing. Nothing appears in the log and it throws a console error:

Uncaught (in promise) Error: Network error: Unexpected token 'l', "flow.Storag"... is not valid JSON at new t (bundle.esm.js:63:28) at Object.error (bundle.esm.js:1030:48) at _ (Observable.js:140:18) at b (Observable.js:179:3) at e.value (Observable.js:240:7) at bundle.esm.js:899:36

Running the Tx again does log an error:

execution error code 1: [Error Code: 1101] error caused by: 1 error occurred:

I'm guessing this means the tx did work the first time?

turbolent commented 2 weeks ago

There seems to be a bug in the Playground and it doesn't handle the result of the first execution of the transaction.

Then when you run it again, like the error says, you're trying to store a capability in /public/HelloAssetTutorial again, but there is now already one stored there. This is expected. Still, the first execution should be handled.