Dfx deploy failed

I don’t know if this is the answer to the problem you are having, but currently the Canister SDK (dfx) doesn’t support macOS with M1 architecture. I’m surprised you were able to install the package, but this might be part of the issue you are running into.

how to solve this issue after run dfx deploy?

The replica returned an HTTP Error: Http Error: status 400 Bad Request, content type “text/plain; charset=utf-8”, content: Failed to connect to host: Connection refused (os error 111)

You’ll need to have a replica running to deploy locally, so in your first terminal run:
dfx start

Then in a second terminal run:
dfx deploy

I fixed this issue by remove yarn.lock and yarn-error.log then run yarn install again.

1 Like

I build the frontend first for my dapp project. After deploying only frontend without any connection to backend it worked well. Terminal 1 dfx start terminal 2 npm install both worked well. And with frontend url I verified frontend and it was as expected. But after connecting the backend now I’m getting frontend failed error message similar to @GaloisField reported.
Error says:

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 post-build step failed for canister 'bd3sg-teaaa-aaaaa-qaaba-cai' (dkeeper_frontend) with an embedded error: Failed to build frontend for network 'local'.: The command '"npm" "run" "build"' failed with exit status 'exit status: 1'.

Also if I check the index,js file in declaration folder then createActor appear strike through as below.

ICP

@GaloisField if you have resolved the error then let us know what was the resolution.

@claudio I also tried building project without fronted dfx new --no-frontend <projname> and that also worked well. But when running original project then getting below error. Is issue with webpack version?

ERROR in ./src/declarations/dkeeper_backend/index.js 4:0-54
Module not found: Error: Can't resolve './dkeeper_backend.did.js' in '/home/navalega0109/ic-projects/dkeeper/src/declarations/dkeeper_backend'
resolve './dkeeper_backend.did.js' in '/home/navalega0109/ic-projects/dkeeper/src/declarations/dkeeper_backend'
  using description file: /home/navalega0109/ic-projects/dkeeper/package.json (relative path: ./src/declarations/dkeeper_backend)
    Field 'browser' doesn't contain a valid alias configuration
    using description file: /home/navalega0109/ic-projects/dkeeper/package.json (relative path: ./src/declarations/dkeeper_backend/dkeeper_backend.did.js)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        /home/navalega0109/ic-projects/dkeeper/src/declarations/dkeeper_backend/dkeeper_backend.did.js doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        /home/navalega0109/ic-projects/dkeeper/src/declarations/dkeeper_backend/dkeeper_backend.did.js.js doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        /home/navalega0109/ic-projects/dkeeper/src/declarations/dkeeper_backend/dkeeper_backend.did.js.ts doesn't exist
      .jsx
        Field 'browser' doesn't contain a valid alias configuration
        /home/navalega0109/ic-projects/dkeeper/src/declarations/dkeeper_backend/dkeeper_backend.did.js.jsx doesn't exist
      .tsx
        Field 'browser' doesn't contain a valid alias configuration
        /home/navalega0109/ic-projects/dkeeper/src/declarations/dkeeper_backend/dkeeper_backend.did.js.tsx doesn't exist
      as directory
        /home/navalega0109/ic-projects/dkeeper/src/declarations/dkeeper_backend/dkeeper_backend.did.js doesn't exist
 @ ./src/dkeeper_frontend/src/components/App.jsx 6:0-72 11:12-38
 @ ./src/dkeeper_frontend/src/index.jsx 3:0-35 4:36-39

webpack 5.69.1 compiled with 1 error in 2591 ms

Also no idea why getting below tsconfig.json error. @Severin Can you help here?

You realize that you are replying to a post from May 2021 ? Also you can check users info e.g. @GaloisField Last Post May 16, '21 Seen Nov 28, '21 so obviously he won’t answer you. Best is to start new topic instead. Also in the weekend many take some time off away from forum but on Monday pretty much every post gets replied to.

1 Like

Hey why are you doing such hypothesis. I’m notified by email.

But about this I saw many new updates in the code and I never tried to link front end and backend.

1 Like

Ok for an hypothesis not sure a solution.

Did you try ˋdfx deploy` before all ?

Such that you canister is already created and only linked in your js.
Maybe you can deploy canister with js but I don’t know how.

The idea I think it’s only to deploy, start and link your canister with your app. In this order.