"Failed to load resource: the server responded with a status of 400 (Bad Request)" problem when trying to link my frontend and backend canister smart contacts in motoko using javascript.

import { dbank } from "../../declarations/dbank";
window.addEventListener("load", async function(){
    const currentValue = await dbank.checkBalance();
    document.getElementById("amount").innerText = currentValue;    
});

so this javascript code is meant to connect the front and back end canisters but when i use the frontend canisters to try the backend functionality implemented by the javascript, i get the error "Failed to load resource: the server responded with a status of 400 (Bad Request". Thanks in advance to anyone that try and helped.

i guess the error is from the ../../declarations/dbank folder cause a previous error i got was "canister is not found" which was also from the declarations/dbank folder and i guess are related but i tried replacing the "process.env.DBANK_CANISTER_ID" from the export canisterId with the actual canister id i found in the '.dfx/local/canisterid.json' folder but didnt work.

0

There are 0 best solutions below