'Error: TodoList has not been deployed to detected network (network/artifact mismatch)
truffle(development)> TodoList = await TodoList.deployed() Uncaught: Error: TodoList has not been deployed to detected network (network/artifact mismatch) at processTicksAndRejections (node:internal/process/task_queues:96:5) at /usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-contract/lib/contract/constructorMethods.js:113:1
Solution 1:[1]
Please follow the steps:
Create another file named 2_anyname.js(make sure it doesn't start with 1 and you can name it anything) in migration folder.
Paste this content in file
var contract_name = artifacts.require('contract_name'); module.exports = function (deployer) { deployer.deploy(contract_name); };run commands in this order : truffle compile -> truffle migrate --reset or truffle deploy --reset -> truffle console
you are good to go !!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Jazz |
