To fix the "Canister ID is required" error, you need to set the backend canister ID in your environment variables.
-
Deploy your backend canister:
cd /mnt/d/BlockDev/Aangan dfx deploy Aangan_backend --network ic -
Get your canister ID:
dfx canister id Aangan_backend --network ic
-
Update your .env file: Edit
/mnt/d/BlockDev/Aangan/src/Aangan_frontend/.envand add:VITE_CANISTER_ID_AANGAN_BACKEND=your-actual-canister-id-here
If you already have a deployed canister, you can manually set the canister ID:
- Find your canister ID from your dfx deployment logs or dfx.json
- Update the .env file as shown above
If you want to test locally:
-
Start local replica:
dfx start --clean
-
Deploy locally:
dfx deploy
-
Update .env for local:
VITE_CANISTER_ID_AANGAN_BACKEND=your-local-canister-id VITE_DFX_NETWORK=local VITE_HOST=http://localhost:4943
After updating the .env file, restart your development server:
cd src/Aangan_frontend
npm run dev- "global is not defined": Fixed with Vite configuration updates
- "Unable to fetch root key": Only affects local development, not production
- "Canister ID is required": Set VITE_CANISTER_ID_AANGAN_BACKEND in .env file
The app is configured to use mainnet Internet Identity (rdmx6-jaaaa-aaaaa-aaadq-cai) for reliable authentication, even in development. This ensures:
- ✅ Consistent authentication experience
- ✅ No local Internet Identity setup required
- ✅ Works across different environments
Your users can create Internet Identity accounts at: https://identity.ic0.app