adrianmcli/truffle-react

"Error: Attempting to run transaction which calls a contract function, but recipient address <Contract Address> is not a contract address"

0xCourtney opened this issue · 2 comments

This message appears after doing a fresh migration, because the contracts file is both in the builds directory and the src you will need to delete the contracts folder in the src directory and copy it from the build directory each time a new build folder is created...

The way the box works is that a symlink is created between the src folder and the build folder for the contracts directory. This is done because Create-React-App does not allow you to require things outside of src. As long as there is a proper symlink, everything will work fine.

However, if you just paste it in, it's likely that your JSON artifacts will become out of date. And that's when you will have trouble finding the addresses for where the contracts are deployed. This is why you say you have to copy it over every time.

It sounds like you are having issues with the symlink. Do not delete it, run npm run link-contracts to re-instate it and it should work.

@ScottWorks check my posting on a related issue for a possible solution:
#2 (comment)