GET http://localhost:5173/api/v2/status 500 (Internal Server Error) request @ chunk-MJ5GGJUQ.js?v=c30b9a6e:4101 _HttpAgent_requestAndRetry2 @ chunk-MJ5GGJUQ.js?v=c30b9a6e:4231 status @ chunk-MJ5GGJUQ.js?v=c30b9a6e:4099 fetchRootKey @ chunk-MJ5GGJUQ.js?v=c30b9a6e:4108 handleAsync @ App.tsx:19 await in handleAsync (anonymous) @ App.tsx:33 commitHookEffectListMount @ chunk-HRGJDPCX.js?v=c30b9a6e:16936 commitPassiveMountOnFiber @ chunk-HRGJDPCX.js?v=c30b9a6e:18184 commitPassiveMountEffects_complete @ chunk-HRGJDPCX.js?v=c30b9a6e:18157 commitPassiveMountEffects_begin @ chunk-HRGJDPCX.js?v=c30b9a6e:18147 commitPassiveMountEffects @ chunk-HRGJDPCX.js?v=c30b9a6e:18137 flushPassiveEffectsImpl @ chunk-HRGJDPCX.js?v=c30b9a6e:19518 flushPassiveEffects @ chunk-HRGJDPCX.js?v=c30b9a6e:19475 (anonymous) @ chunk-HRGJDPCX.js?v=c30b9a6e:19356 workLoop @ chunk-HRGJDPCX.js?v=c30b9a6e:197 flushWork @ chunk-HRGJDPCX.js?v=c30b9a6e:176 performWorkUntilDeadline @ chunk-HRGJDPCX.js?v=c30b9a6e:384 Show 15 more frames Show less
other people run the github repo fine, but I got it only on my mac
import {AuthClient} from "@dfinity/auth-client";
import {Actor, HttpAgent} from "@dfinity/agent";
import {_SERVICE} from "../declarations/backend/backend.did";
import {canisterId, idlFactory} from "../declarations/backend";
import {useEffect} from "react";
import {logger} from "./DevUtils/logData";
function App() {
useEffect(() => {
async function handleAsync() {
const client = await AuthClient.create();
const identity = await client.getIdentity()
const agent = new HttpAgent({
identity,
host: import.meta.env.VITE_IC_HOST
});
console.log("before....")
agent.fetchRootKey().catch(err => {
console.log(err)
});
// console.log("fetchRootKey....")
// const actor = Actor.createActor<_SERVICE>(idlFactory, {
// agent,
// canisterId,
// });
//
// let res = await actor.get_initial_data();
// console.log({res})
}
handleAsync();
}, [])
return <h1>x</h1>
}
export default App;
my mac info
ast login: Tue Aug 13 19:25:47 on ttys001
ahmed@AHMEDs-MacBook-Pro ~ % node --version
v22.6.0
ahmed@AHMEDs-MacBook-Pro ~ % dfx --version
dfx 0.22.0
ahmed@AHMEDs-MacBook-Pro ~ % rustup --version
rustup 1.27.1 (54dd3d00f 2024-04-24)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.78.0 (9b00956e5 2024-04-29)`
VITE_INTERNET_IDENTITY='bd3sg-teaaa-aaaaa-qaaba-cai'
POCKET_IC_BIN='/usr/local/bin/pocket-ic'
BACKEND_WASM='/Users/ahmed/Desktop/odoc/target/wasm32-unknown-unknown/release/backend.wasm'
VITE_DFX_NETWORK='local'
VITE_DFX_PORT=8080
VITE_IC_HOST=http://localhost:5173
# DFX CANISTER ENVIRONMENT VARIABLES
DFX_VERSION='0.22.0'
DFX_NETWORK='local'
CANISTER_ID_INTERNET_IDENTITY='bd3sg-teaaa-aaaaa-qaaba-cai'
CANISTER_ID_BACKEND='bkyz2-fmaaa-aaaaa-qaaaq-cai'
CANISTER_ID='bd3sg-teaaa-aaaaa-qaaba-cai'
CANISTER_CANDID_PATH='/Users/ahmed/Desktop/odoc/.dfx/local/canisters/internet_identity/internet_identity.did'
# END DFX CANISTER ENVIRONMENT VARIABLES