You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Error Code: 1101] error caused by: 1 error occurred:
* transaction preprocess failed: [Error Code: 1101] cadence runtime error: Execution failed:
error: [Error Code: 1054] location (Person) is not a valid location: expecting an AddressLocation, but other location types are passed
--> Person
error: cannot find type in this scope: `Person`
--> df15814c58d0250b708d7bc1101e7e624598fa18479bbf8c51f43c7536686157:15:23
|
15 | self.acc.save<@Person.Friendship>(<-Person.makeFriends(), to: StoragePath(identifier: "friendship")!)
| ^^^^^^ not found in this scope
error: cannot find variable in this scope: `Person`
--> df15814c58d0250b708d7bc1101e7e624598fa18479bbf8c51f43c7536686157:15:44
|
15 | self.acc.save<@Person.Friendship>(<-Person.makeFriends(), to: StoragePath(identifier: "friendship")!)
| ^^^^^^ not found in this scope
I checked the transaction source that was executed on the blockchain and saw that the import "Person" wasn’t properly replaced with the address of the account where it is deployed:
import"Person"// ...
But when executing the same transaction using Flow CLI, the import was resolved/replaced properly:
What are you currently working on that this is blocking?
This is blocking us from testing (and releasing) the new Flowser app version with "Interact screen", which includes a way to execute scripts or transactions using the new import syntax: onflow/developer-grants#150
The text was updated successfully, but these errors were encountered:
Turns out that when I executed the transaction that was causing the issue, flow.json that I used wasn't updated to reflect the latest contract deployment status (the deployments section), so FCL probably couldn't resolve the imported contract.
Just tested now, and it works when flow.json is correctly configured.
Current Behavior
I scaffolded a new project using this template: https://github.com/sideninja/flow-basic-scaffold
After the project setup, my config for Person contract looked like this:
But when I ran
flow dev
and tried executingmakeFriends.cdc
transaction with FCL, that failed with error:I checked the transaction source that was executed on the blockchain and saw that the
import "Person"
wasn’t properly replaced with the address of the account where it is deployed:But when executing the same transaction using Flow CLI, the import was resolved/replaced properly:
Note that my FCl instance is properly configured using
load({ flowJSON })
: https://developers.flow.com/tooling/fcl-js/api#using-flowjsonExpected Behavior
Imports in transactions or scripts should resolve consistently between all Flow tools (e.g. Flow CLI and FCL in this case).
Specifically, the flow.json format used by the
flow dev
command should also work with FCL.Steps To Reproduce
flow setup my-flow-project --scaffold
and enter2
(Simple Cadence Project)cd my-flow-project && flow dev
fcl.load({ flowJSON })
, where flowJSON is the contents ofmy-flow-project/flow.json
fcl.query({ cadence: makeFriendsSource })
, wheremakeFriendsSource
is this cadence code: https://github.com/sideninja/flow-basic-scaffold/blob/main/cadence/transactions/makeFriends.cdc (any other cadence code using the new import syntax should also reproduce the same issue)fcl.query
should return something similar to the error I described aboveEnvironment
What are you currently working on that this is blocking?
This is blocking us from testing (and releasing) the new Flowser app version with "Interact screen", which includes a way to execute scripts or transactions using the new import syntax: onflow/developer-grants#150
The text was updated successfully, but these errors were encountered: