After updating from dfx version 0.13.1 to 0.15.1, I get an error when attempting to call dfx build CANISTER_NAME --network ic

I just updated the DFX SDK from version 0.13.1 to version 0.15.1, and now whenever I attempt to call the dfx build function on the ICP network, I get the following error message:

  Failed while trying to build all canisters in the canister pool.
    Failed to build dependencies graph for canister pool.
      Failed to get dependencies for canister 'default'.
        Failed to create <Type>CanisterInfo for canister 'default'.
          `main` attribute is required on Motoko canisters in dfx.json

does anyone know what breaking change I may be encountering and how I could resolve it?

I can’t find any relevant breaking changes in our changelog (search for !: to find all the breaking changes). Can you show the dfx.json entry for default? I suspect there’s something up with that

2 Likes

I resolved it. I had some dead code that was breaking things. I removed it

2 Likes

I meet the same problem, how do you solve it?

Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
  Failed to build all canisters.
    Failed while trying to build all canisters.
      The build step failed for canister 'by6od-j4aaa-aaaaa-qaadq-cai' (root_fetch) with an embedded error: Failed to build Rust canister 'root_fetch'.: Failed to create <Type>CanisterInfo for canister 'root_fetch'.: No package `fetch/root_fetch` found

How do you define the root_fetch canister in dfx.json? and where is the entry point (main .mo file, Cargo.toml, or whatever you use) located?

I change the canister type from “rust” to “custom”, and i solve the problem.