I have a svelte project with the following structure:
src/backend
frontend
declarations
When I use the canister ID i imported with:
import { idlFactory, canisterId } from "../../../declarations/backend";
I get:
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.
Even though my “.env” file is populated:
CANISTER_ID_BACKEND='by6od-j4aaa-aaaaa-qaadq-cai'
...