onflow/flow-playground

Failed to Deploy Contract in Playground

Closed this issue · 3 comments

Describe the bug
When I'm trying to deploy contracts in a playground project, an error pops up saying "Oops! Something went wrong. If you'd like, please report the Bug. Thank you!". I checked the console and the GraphQL request, there's no additional useful information. I suppose the problem originates from the backend of the playground.

To Reproduce

  1. Open this project
  2. Navigate to Contract 1 and deploy it to account 0x05
  3. Navigate to Contract 2 and try to deploy it to account 0x06, the error should then appear

Screenshot
Screenshot

Environment:

  • OS: Windows 11 Enterprise 23H2
  • Browser: Microsoft Edge 121.0.2277.128 (Also tested on Mozilla Firefox 122.0.1)

Additional context
Here's the HTTP response from the server regarding the deployment request:

{
    "errors": [
        {
            "message": "something went wrong, we are looking into the issue",
            "path": [
                "createContractDeployment"
            ],
            "extensions": {
                "code": "INTERNAL_SERVER_ERROR"
            }
        }
    ],
    "data": null,
    "extensions": {
        "code": "INTERNAL_SERVER_ERROR"
    }
}

I’ve pinpointed the root cause of the problem by testing the project in a local emulator. The FlowToken.cdc contract, being a core component, is already deployed to all users. Attempting to re-deploy it results in a conflict because the path /storage/flowTokenVault already contains an object.

However, there remains an issue with the playground: it fails to effectively communicate error messages to users. When contract deployment or transaction execution encounters failure, providing clear error messages is crucial. This helps users better understand the problem and facilitates troubleshooting.

Thanks for reporting the issue. We'll be updating the backend to support Cadence 1.0 development. We'll have a newer version of the emulator that has core contracts already deployed. We plan on exposing these to the user so dev is more straight forward. We'll make sure to pass the errors to the UI so they are more clear.

the backend is officially supports cadence 1.0, and it should handle new syntax without any issues
feel free to reopen the issue if it still doesn't work