Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【mission-2】Error Type mismatch #19

Open
mashharuki opened this issue Nov 9, 2022 · 1 comment
Open

【mission-2】Error Type mismatch #19

mashharuki opened this issue Nov 9, 2022 · 1 comment

Comments

@mashharuki
Copy link

Describe the bug
Error Type mismatch occured in mission-2. it's LIST_DAPPY_TEMPLATE script.

To Reproduce
Steps to reproduce the behavior:

  1. add this scripts to list-dappy-templates.script.js
export const LIST_DAPPY_TEMPLATE = `
    import DappyContract from 0xDappy

    pub fun main(): { UInt32: DappyContract.Template } {
        return DappyContract.listTemplates()
    }
`;
  1. execute a command sh run.sh
  2. Go to dappies page.
  3. error occured

Expected behavior
console

{
	"code": 400,
	"message": "Invalid Flow argument: failed to execute the script on the execution node execution-5f6c73a22445d7d958c6a37c1f3be99c72cacd39894a3e46d6647a9adb007b4d@execution-001.devnet38.nodes.onflow.org:3569=100: rpc error: code = InvalidArgument desc = failed to execute script: failed to execute script at block (39e392a18fe68ade2fc4a1a4461f48472bd0c0a36c1e3bd71ea78f0927b0bb4c): [Error Code: 1101] error caused by: [Error Code: 1101] cadence runtime error: Execution failed:\nerror: mismatched types\n   --\u003e db3d539e48a805b7.DappyContract:225:21\n    |\n225 |     let familyRef = \u0026self.families[familyID] as! \u0026Family\n    |                      ^^^^^^^^^^^^^^^^^^^^^^^ expected `DappyContract.Family`, got `DappyContract.Family?`\n\nerror: mismatched types\n   --\u003e db3d539e48a805b7.DappyContract:240:21\n    |\n240 |     let familyRef = \u0026self.families[familyID] as! \u0026Family\n    |          ...  find type in this scope: `DappyContract`\n --\u003e 89f4de94e0a12e080f0d2facf1e3ff0213e4dc5001a93b5f94b2ec3454194088:4:30\n  |\n4 |     pub fun main(): { UInt32: DappyContract.Template } {\n  |                               ^^^^^^^^^^^^^ not found in this scope\n\nerror: cannot find variable in this scope: `DappyContract`\n --\u003e 89f4de94e0a12e080f0d2facf1e3ff0213e4dc5001a93b5f94b2ec3454194088:5:15\n  |\n5 |         return DappyContract.listTemplates()\n  |                ^^^^^^^^^^^^^ not found in this scope\n"
}

Screenshots
スクリーンショット 2022-11-09 22 54 24

Desktop (please complete the following information):

  • OS: Mac OS (M1)
  • Browser chrome
  • Version 107.0.5304.87
@mashharuki
Copy link
Author

My confif.jsfile is here

import { config } from "@onflow/fcl";

config({
    "accessNode.api": process.env.REACT_APP_ACCESS_NODE,
    "discovery.wallet": process.env.REACT_APP_WALLET_DISCOVERY,
    "0xDappy": process.env.REACT_APP_DAPPY_CONTRACT,
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant