Local Internet-identity front-end build is failing

I just cloned the the repo for the internet identity canister and UI. can anyone help me resolve this issue? I am using Mac M1 os. I’m trying to run the repo locally, using the instructions from here
but when I run the following command:

dfx deploy --no-wallet --argument '(null)'

I’m getting this error message in the console:

Building canisters...
Building frontend...
Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
  Failed to build call canisters.
    Failed while trying to build all canisters.
      The post-build step failed for canister 'rwlgt-iiaaa-aaaaa-aaaaa-cai' (internet_identity) with an embedded error: No such file or directory (os error 2)```

on another note, I consistently run into problems when upgrading to the most recent repo fo the internet identity and trying to run it locally. Each time i pull the latest version of the internet identity repo, i encounter some sort of build fail thats specific to Mac M1 OS. The solution to the issue often requires multiple days of searching through the forum and through github for solutions to the issue and that often stalls development for a few days. I think it’d be really helpful if the README.md file included a separate set of instructions for users operation on Mac M1 OS. @diegop could you see to it that the right person is CC’d on this?

You want to debug or develop II locally or you want to deploy II locally to develop your own app?

@peterparker , i want to deploy II canister locally. And I’m getting the above error message when i attempt to do so.

I gonna assume you want to deploy II to work on your dapp - i.e. not to implement something within II.

As I actually answered this question few times (here on the forum, discord or twitter), I thought that I was maybe actually worth a blog post. So, here you go.

Let me know if it works out for you?

2 Likes

@peterparker I attempted option 2. I made sure that dfx start was running and I ran the following commands:

git clone https://github.com/dfinity/internet-identity
cd internet-identity/demos/using-dev-build
npm ci
dfx deploy --no-wallet --argument '(null)'

and the console is still giving me the following error:

Building canisters...
Building frontend...
Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
  Failed to build call canisters.
    Failed while trying to build all canisters.
      The post-build step failed for canister 'rwlgt-iiaaa-aaaaa-aaaaa-cai' (internet_identity) with an embedded error: No such file or directory (os error 2)

Work out for me :man_shrugging:.

Maybe you local dfx state is dirty? dfx start --clean maybe?

i gave it a shot, and still no success. are you using Mac M1?

I got a M2.

Super weird. Have you try the first method? Same result?

P.S.: Just updated the article to simplify the 1. solution

@peterparker haven’t tried the first method just yet. I just upgraded to the latest dfx version and gave it another attempt. now I’m getting this error message:

Error: Failed to fetch root key.
Caused by: Failed to fetch root key.
  Encountered an error while trying to query the replica.
    An error happened during communication with the replica: error sending request for url (http://127.0.0.1:4943/api/v2/status): error trying to connect: tcp connect error: Connection refused (os error 61)

This error looks a bit more familiar.

Ah I had that one too few minutes ago when I was double checking that the method worked out!

dfx start --clean and cloning II in a fresh repo solved it for me.

1 Like

And its working! thanks a bunch :pray:t5:

1 Like

Awesome! Happy to hear that :smiley:

so, Its deploying, but for some reason, instead of the Internet identity UI, I’m seeing this:

and when i click “Authenticate” its redirecting me to the II thats on mainnet.

It’s probably because you collected the wrong canister ID for the local Internet Identity.

It’s that one I think

@peterparker I ended up having to change the URL for the local version of the II interface. It was still pointing to localhost:8000, but the last version of the II is deployed to localhost:4943. So I’ve gotten my project deployed locally along with the II. and now I’m getting an error message in the browser console.

I suspect this error is due to the fact that my II canister and my project aren’t running on the same port. My project is running on localhost:8000 while the II canister is running on localhost:4943.

Is there a solution to this that doesn’t involve me having to run both canisters on the same port?

if not, how do i go about changing the port that II canister runs on?

Ummm I never run on that issue. Maybe the 2. solution does not fit well your setup. Can you give a try to the 1. one?

i.e. deploy II locally through dfx with following config

"internet_identity": {
      "type": "custom",
      "candid": "https://github.com/dfinity/internet-identity/releases/latest/download/internet_identity.did",
      "wasm": "https://github.com/dfinity/internet-identity/releases/latest/download/internet_identity_dev.wasm",
      "shrink": false,
      "remote": {
        "candid": "internet_identity.did",
          "id": {
            "ic": "rdmx6-jaaaa-aaaaa-aaadq-cai"
          }
        }
      }
	},

I gave option 1 a try and it deploys fine, but this option doesn’t provide the II user interface that I need. I only get the backend canister. is there somewhere I could find the dfx configs for the UI of the II canister too?

Ummm that’s weird, in my projects using such method I get the II user interface - i.e. I can then use II to sign in locally with my dapps. As both methods works in my dapps and sample repo, not sure what’s the issue here.

Your project is open source?

I just changed the visibility so that you can see it. You can find it here at this link: GitHub - JessAYrn/Digital-Time-Capsule

1 Like