Mainnet frontend crash with LedgerActor

get this error when i deploy to the ic while calling the ledger canister from the frontend with the ledger actor

index.js:2 Uncaught Error: Canister ID is required, but received undefined instead.
 If you are using automatically generated declarations, this may be because your application is not setting the canister ID in process.env correctly.
    at ep.createActor (index.js:2:805351)

Can you show how you set up that actor? Including e.g. dfx.json and other relevant parts?

1 Like

the dfx.json -

{
  "canisters": {
    "game_bloc_backend": {
      "candid": "game_bloc_backend/game_bloc_backend.did",
      "package": "game_bloc_backend",
      "type": "rust"
    },

    "kitchen": {
      "main": "bloc/kitchen.mo",
      "type": "motoko",
      "dependencies": ["game_bloc_backend", "icp_ledger", "icp_index"]
    },

    "icp_ledger": {
      "type": "custom",
      "candid": "https://raw.githubusercontent.com/dfinity/ic/d87954601e4b22972899e9957e800406a0a6b929/rs/rosetta-api/icp_ledger/ledger.did",
      "wasm": "https://download.dfinity.systems/ic/d87954601e4b22972899e9957e800406a0a6b929/canisters/ledger-canister.wasm.gz",
      "remote": {
        "id": {
          "ic": "ryjl3-tyaaa-aaaaa-aaaba-cai"
        }
      }
    },

    "icp_index": {
      "type": "custom",
      "candid": "https://raw.githubusercontent.com/dfinity/ic/d87954601e4b22972899e9957e800406a0a6b929/rs/rosetta-api/icp_ledger/index/index.did",
      "wasm": "https://download.dfinity.systems/ic/d87954601e4b22972899e9957e800406a0a6b929/canisters/ic-icp-index-canister.wasm.gz",
      "remote": {
        "id": {
          "ic": "qhbym-qaaaa-aaaaa-aaafq-cai"
        }
      }
    },

    "gamebloc_new_frontend": {
      "dependencies": ["kitchen", "game_bloc_backend", "icp_index", "icp_ledger"],
      "frontend": {
        "entrypoint": "src/gamebloc_new_frontend/src/index.html"
      },
      "source": [
        "src/gamebloc_new_frontend/assets",
        "dist/gamebloc_new_frontend/"
      ],
      "type": "assets"
    }
  },
  "defaults": {
    "build": {
      "args": "",
      "packtool": "vessel sources"
    }
  },
  "output_env_file": ".env",
  "version": 1
}


These are the relevant files