Error: "No canisters in the configuration file." Dfinity Motoko dfx

195 views Asked by At

enter image description here

I don't understand whats going wrong here, I'm fed up with Dfinity and today I realise the problem of Un-Maintained piece of technology and so much of uncertainities in Web 3 now. I wasn't able to find anything related.

1

There are 1 answers

1
David Okolie On

After many tries, I finally fixed the issue

Try updating your dfx.json with the adequate configuration, and also delete .dist file if you have it before your deployment.

dfx.json

`

{

"canisters":

{

  "[your canister name]":
      {
    "main": "src/[your canister name]/main.mo",

    "type": "motoko"
  },

  "[your canister name]_assets": {
    "dependencies": [
      "[your canister name]"
    ],

    "frontend": {
      "entrypoint": "src/[Your canister name]_assets/src/index.html"
    },

    "source": [
      "src/[Your canister name]_assets/assets",
      "dist/[your cannister name]_assets/"
    ],

    "type": "assets"
  }
},

"defaults": {
  "build": {
    "args": "",
    "packtool": ""
  }
},

"dfx": "[Ensure you put your Dfx version]",
"networks": {
  "local": {
    "bind": "127.0.0.1:8000",
    "type": "ephemeral"
  }

},

"version": 1

}