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.


Debug your app, what DFX_NETWORK value do you get there:

Once you know which value you get, debug your configuration to see what DFX_NETWORK is set there:

Note related to your issue probably but still: I suggest to replace this line with

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