VITE_DFX_NETWORK Incorrect

Hi,

I’ve deployed a new frontend written in svelte but the frontend is trying to call my local canister paths:

My vite config is here:

Any help appreciated.

Thanks,
James

Debug your app, what DFX_NETWORK value do you get there: https://github.com/jamesbeadle/OpenFPL/blob/b99a0a087863b750db16110854767765b58993d9/src/OpenFPL_frontend/src/utils/ActorFactory.ts#L16

Once you know which value you get, debug your configuration to see what DFX_NETWORK is set there: https://github.com/jamesbeadle/OpenFPL/blob/b99a0a087863b750db16110854767765b58993d9/vite.config.ts#L96

Note related to your issue probably but still: I suggest to replace this line https://github.com/jamesbeadle/OpenFPL/blob/b99a0a087863b750db16110854767765b58993d9/src/OpenFPL_frontend/src/utils/ActorFactory.ts#L19 with https://icp-api.io.

1 Like

When I debug locally I get ‘local’. I don’t know how to read DFX_NETWORK from my live frontend.

Thank you, I’ve updated it!

I mean debug your prod build, the one you deploy on mainnet.

Sure but I don’t know how to read DFX_NETWORK from my production build.


So in the compiled code it is local.

You can add a console.log and redeploy (it does not work anyway so it won’t arm).

Then “local” is incorrect. Now next step, debug your vite.config. What do you get there as DFX_NETWORK when you npm run build

Ok it was the adapter, I changed it from static to auto when I implemented the custom tailwind config as per their docs.

Changing it back works, will need to see if it has effected the tailwind implementation.

Thanks for your help.

1 Like