# Issue with Deploying Frontend on Mainnet

**URL:** <https://forum.dfinity.org/t/issue-with-deploying-frontend-on-mainnet/40414>\
**Category:** Developers\
**Tags:** Functional-Programming, Frontend\
**Created:** [January 23, 2025, 11:16am UTC](https://forum.dfinity.org/t/issue-with-deploying-frontend-on-mainnet/40414 "2025-01-23T11:16:54Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![nourAhmed123](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/nourahmed123/32/20737_2.png) [@nourAhmed123](https://forum.dfinity.org/u/nourAhmed123)\
**Post date:** [January 23, 2025, 11:16am UTC](https://forum.dfinity.org/t/issue-with-deploying-frontend-on-mainnet/40414/1 "2025-01-23T11:16:54Z")

</div>

I’m encountering a frustrating issue while deploying my frontend on mainnet.

When I deploy the application locally, everything works perfectly, and I’m able to interact with all features. However, when I deploy it on the mainnet, the following problems occur:

I tried to reinstall the canister but the frontend behaves unexpectedly. For example, when I press the “Connect to Wallet” button, it redirects to the **local Internet Identity (II)** instead of the mainnet version.

**Has anyone faced a similar issue or knows how to resolve this?**

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/3X/6/6/6629793ec00267e0819e5df1a55517b360055b95.png)  
 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/3X/b/1/b104fe57b01c217ec431e75a0ed681536834f549.png)  
 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/3X/e/0/e02d8a57ce3f54c9cb1942af946296d9c2f6c278.png)

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [January 23, 2025, 12:10pm UTC](https://forum.dfinity.org/t/issue-with-deploying-frontend-on-mainnet/40414/2 "2025-01-23T12:10:46Z")

</div>

Same bug is discussed here:

> [@Deploying (the icp ledger canister) to production](https://forum.dfinity.org/t/deploying-the-icp-ledger-canister-to-production/33133/5):
>
> Looks like a bug that I ran into recently as well. [This](https://github.com/sesi200/fortune-wheel/blob/main/scripts/download-idl.sh) is the workaround I came up with. You need to adjust the for loop at the bottom with your canister names. If you run this before dfx deploy --ic it should work. Note to self: [internal ticket](https://dfinity.atlassian.net/browse/SDKTG-357)

No updates on a fix so far…

---

<div class="post-metadata">

**Author:** ![nourAhmed123](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/nourahmed123/32/20737_2.png) [@nourAhmed123](https://forum.dfinity.org/u/nourAhmed123)\
**Post date:** [January 23, 2025, 12:58pm UTC](https://forum.dfinity.org/t/issue-with-deploying-frontend-on-mainnet/40414/4 "2025-01-23T12:58:16Z")

</div>

i tried to execute the file but it gives me this error ./download.sh: line 13: jq: command not found  
./download.sh: line 14: jq: command not found  
curl: (3) URL using bad/illegal format or missing URL  
Error: Failed to download  
./download.sh: line 13: jq: command not found  
./download.sh: line 14: jq: command not found  
curl: (3) URL using bad/illegal format or missing URL  
Error: Failed to download  
./download.sh: line 13: jq: command not found  
./download.sh: line 14: jq: command not found  
curl: (3) URL using bad/illegal format or missing URL  
Error: Failed to download

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [January 23, 2025, 1:00pm UTC](https://forum.dfinity.org/t/issue-with-deploying-frontend-on-mainnet/40414/5 "2025-01-23T13:00:19Z")

</div>

`brew install jq` or `apt install jq` should help

---

<div class="post-metadata">

**Author:** ![nourAhmed123](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/nourahmed123/32/20737_2.png) [@nourAhmed123](https://forum.dfinity.org/u/nourAhmed123)\
**Post date:** [January 23, 2025, 1:27pm UTC](https://forum.dfinity.org/t/issue-with-deploying-frontend-on-mainnet/40414/6 "2025-01-23T13:27:46Z")

</div>

![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/3X/c/e/ce0028d9cdb603f47c26dd7107c2b40448b3ff06.png)  
i have executed the file but this solution does not work with me , so untill the bug being fixed what should i do ? i there a solution or i have to create new canister or what !!

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [January 23, 2025, 1:58pm UTC](https://forum.dfinity.org/t/issue-with-deploying-frontend-on-mainnet/40414/7 "2025-01-23T13:58:40Z")

</div>

Is it still complaining that dfx generate fails or is there a different error?

---

<div class="post-metadata">

**Author:** ![nourAhmed123](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/nourahmed123/32/20737_2.png) [@nourAhmed123](https://forum.dfinity.org/u/nourAhmed123)\
**Post date:** [January 23, 2025, 2:26pm UTC](https://forum.dfinity.org/t/issue-with-deploying-frontend-on-mainnet/40414/8 "2025-01-23T14:26:56Z")

</div>

yes still the same error

---

<div class="post-metadata">

**Author:** ![nourAhmed123](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/nourahmed123/32/20737_2.png) [@nourAhmed123](https://forum.dfinity.org/u/nourAhmed123)\
**Post date:** [January 23, 2025, 5:35pm UTC](https://forum.dfinity.org/t/issue-with-deploying-frontend-on-mainnet/40414/9 "2025-01-23T17:35:27Z")

</div>

do you know what is the reason of this bug?

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [January 24, 2025, 9:15am UTC](https://forum.dfinity.org/t/issue-with-deploying-frontend-on-mainnet/40414/10 "2025-01-24T09:15:28Z")

</div>

in the prebuild step, for remote canisters dfx should download the canister’s candid file and put it in the place where the error says it’s not found. For some reason this doesn’t happen for remote canisters. The script I linked you to didn’t do that right in this case. If you ask an LLM to fix it for you together with the error it may be able to fix it for you

---

<div class="post-metadata">

**Author:** ![anon74414410](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anon74414410](https://forum.dfinity.org/u/anon74414410)\
**Post date:** [February 3, 2025, 5:16pm UTC](https://forum.dfinity.org/t/issue-with-deploying-frontend-on-mainnet/40414/11 "2025-02-03T17:16:59Z")

</div>

Can you share the part of the code where you call the `login` method on the auth client?
