https://github.com/maxstalker/fcl-panic-result
https://github.com/maxstalker/fcl-panic-result
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/maxstalker/fcl-panic-result
- Owner: MaxStalker
- Created: 2021-06-23T17:16:20.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-23T22:49:30.000Z (almost 5 years ago)
- Last Synced: 2025-02-26T18:42:21.471Z (over 1 year ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Solution
I've discovered that Flow CLI on MacOS machine had version `0.20.0`, while one one Linux had latest (at time of this post) `0.24.0`.
Updating the version to latest solved the issue.
Case closed!
-----------------------------
# Problem
When Cadence scripts calls `panic` we are getting `failed to encode value: unsupported value: , ` instead of actual error we see in emulator output. This behaviour I encounter on my Mac, but not on Linux machine...
# Who is affected
Pretty much every developer who is using `fcl` and writes Cadence, since it's much harder to find where error occurred.
# How to replicate
- launch emulator with `flow emulator -v`
- run script from root of this project `node index.js`
# Expected outcome
```js
[Error Code: 1101] cadence runtime error Execution failed:
error: panic: Uh-oh
--> a0b8feeb4782c0bab8156663a881e3748f472f83332304cb593b15a45eaaeea7:2:16
|
2 | panic("Uh-oh")
| ^^^^^^^^^^^^^^
```
Below you can find screenshot from my Linux machine 
# Additional notes
I've seen this working just fine on my Linux machine returning `[error code 1101]` and then actual place where this is happening.
Same package versions, Node v16.3.0.