Problem with front end canister

Loading please wait…, I get this, checked terminal, just see warnings so it does not seem anything is wrong.

import hello_location from ‘ic:canisters/hello_location’;
hello_location.greet(window.prompt(“Enter your name:”)).then(greeting => {
window.alert(greeting);
});

I am following hello_location example from website.

Here is the URL I am using: http://localhost:8000/?canisterId=ic:B74AB9177366A22CFBl, thank you.

2 Likes

Hmmm which step is this at? There shouldn’t be need to use any front end javascript at all for that tutorial, it’s all on the command line?

1 Like

I am trying to get the hello location to have a front end part so I am blending the hello name tutorial with the hello location.

Oh I see, you’ll need to change:
hello_location.greet
to
hello_location.location
where “location“ is the name of your exposed public function in main.mo.

Then build and install the canister again (remember to grab the new canister id to put in the URL too).

Ok thank you that seemed to generate the text box for me input my name but I still see “Loading please wait…” any reason for this?

2 Likes

Which browser are you using?

I am using Google Chrome.

Are you getting any errors in Chrome’s developer console (press F12)?

Also, does a brand new project without any changes made run successfully in the browser? It might be worth carefully comparing this with your modified project files.

1 Like

Ok thanks Ori. I will try that.

Maybe this tutorial helps

https://sdk.dfinity.org/developers-guide/tutorials/custom-frontend.html

2 Likes