Dfx deploy failed [Another]

Hi I’m trying to run dfx deploy and got this errors (though I did dfx start)

Deploying all canisters.
All canisters have already been created.
Building canisters...
Building frontend...
Installing canisters...
Module hash 487bcaa0ce88b036b5ec661d4bb87d264d2cd7225870384cec73034882165e84 is already installed.
Module hash 07221ae340eee0bfb91f482b9b6831dda530fe57110ea7dcc7051ceb38c5f36f is already installed.
Module hash 183df2eb0f1846054e26e3ed17308c65dd0c7af079cd8896406dd959691004bb is already installed.
Uploading assets to asset canister...
Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
  Failed while trying to install all canisters.
    Failed to install wasm module to canister 'opend_assets'.
      Failed to store assets in canister 'opend_assets'.
        Failed asset sync with canister r7inp-6aaaa-aaaaa-aaabq-cai.
          Asset with key '/logo.png' defined at /home/lemeniodo/Desktop/WORKSPACE/Web3/opend-starting/opend/dist/opend_assets/logo.png and /home/lemeniodo/Desktop/WORKSPACE/Web3/opend-starting/opend/src/opend_assets/assets/logo.png

This is likely caused by this breaking change in dfx 0.11.0. Can you try applying the fix suggested in the changelog?

5 Likes

Hi, thank you for replying, I solved the problem

1 Like

Dear, can you please share how did you solve the problem?
I’m using dfx version 0.12.1

  1. Open the “webpack.config.js” file at the root folder of the project and comment/delete the following lines:

image

  1. Delete the “dist” folder at the project’s root dir

  2. Run dfx deploy again

That worked for me.

1 Like

I noticed that while that works fine for the main net, it will break the assets in the local host.

To solve that dfx 0.11.0 breaking change in both, you must do:

process.env.NODE_ENV !== "production"? 
      new CopyPlugin({
        patterns: [
          {
            from: path.join(__dirname, "src", frontendDirectory, "assets"),
            to: path.join(__dirname, "dist", frontendDirectory),
          },
        ],
      })
    :
      () => undefined,