No such file or directory

Stderr:
/home/trizzkunn/FINECHAIN-8/hackathon/hackathon_backend/main.mo: No such file or directory

I got an error like this, even though the main.mo file is in the hackathon_backend folder. Is there a solution to overcome this?

Please post the line with import ... here. Maybe you have a typo in that line. Also if this is your main.mo , then it should be in the dfx.json instead?

In import line on main.mo is normal, im folowing docs internet identity auth:

import Principal “mo:base/Principal”;

persistent actor Whoami {
public query (message) func whoami() : async Principal {
message.caller;
};
};

And this is the code dfx.json:

{
“canisters”: {
“hackathon_backend”: {
“main”: “hackathon_backend/main.mo”,
“type”: “motoko”,
“args”: “–enhanced-orthogonal-persistence”
},
“hackathon_frontend”: {
“dependencies”: [“hackathon_backend”],
“frontend”: {
“entrypoint”: “hackathon_frontend/index.html”
},
“source”: [“hackathon_frontend/dist”],
“type”: “assets”
},
“internet_identity”: {
“candid”: “https://github.com/dfinity/internet-identity/releases/latest/download/internet_identity.did”,
“type”: “custom”,
“specified_id”: “rdmx6-jaaaa-aaaaa-aaadq-cai”,
“remote”: {
“id”: {
“ic”: “rdmx6-jaaaa-aaaaa-aaadq-cai”
}
},
“wasm”: “https://github.com/dfinity/internet-identity/releases/latest/download/internet_identity_dev.wasm.gz
}
},
“output_env_file”: “.env”,
“defaults”: {
“build”: {
“packtool”: “mops sources”
}
}
}

You intend to use mops. Do you have it installed?

I tried to recreate your project from scratch. I did

 5079  dfx new trizz
 5080  cd trizz
 5099  npm install ic-mops
 5110  npm exec -c 'mops init'
 5119  npm exec -c 'mops add base@0.14.8'
 5112  npm exec -c 'dfx build'
 5121  npm exec -c 'dfx deploy'
 5122  dfx canister call trizz_backend --query whoami