[Solved] Contract has not been not deployed to detected network

broadbear Asks: Contract has not been not deployed to detected network
I’m trying to access a smart contract in my local dev environment, but it doesn’t appear to be deploying fully. In summary, I get what seems to be a successful migration, however, I am not able to access the contract using web3.js/truffle-contract.js, and I get the following response in truffle console (MyToken.deployed() does return the expected contract info):

truffle(development)> MyTokenCrowdsale.deployed();
Error: MyTokenCrowdsale has not been deployed to detected network (network/artifact mismatch)

All tests against the ‘Crowdale’ contract pass

The output from truffle migrate is:

Running migration: 1_initial_migration.js
  Deploying Migrations...
  ... 0xa85fc78b1b630c0234376fcf3cb27f47c10cda7c0c35c517518b017edaa31b97
  Migrations: 0x417007b8fcd1a9c970f03756857ff27ebb61135f
Saving artifacts...
Running migration: 2_deploy_crowdsale.js
  Deploying MyToken...
  ... 0x7d5c3d4d6d60139001eab8621cec5b98cf893a44786abb96e901fe942bcdea47
  MyToken: 0xd4bd879faa59c4b5b3af1e9074d71ab407cb19da
Saving artifacts...
  Deploying MyTokenCrowdsale...
  ... 0xe469c8fbd19895674074d6fbeb2b3bcf1d2adaefc07aabf74254aa99678f275e
  MyTokenCrowdsale: 0x35b66ed95a88157ddaf85c20a1d3d189c5cdafa3

I’m running a local dev node with ganache-cli. The network config is:

    development: {
     host: "",     // Localhost (default: none)
     port: 8545,            // Standard Ethereum port (default: none)
     network_id: "*",       // Any network (default: none)
    ganache: {
      post: 'localhost',
      port: 8545,
      networkd_id: '*'


Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.