Strange, can you define two variables named serverUrl and appId and then use Moralis.start(serverUrl, appId)
?
serverUrl = âhttp://localhost:1337/serverâ;
appId = 154;
await Moralis.start(serverUrl, appId);
same error
calling from button
{!isAuthenticated && (
<Button
color=âprimary-altaâ
className=âconnectBtnâ
size=âsmallâ
onClick={
() => handleAuth(âmetamaskâ)
//authent()
// authenticate({ signingMessage: âEcommerce Appâ })
}
// disabled={isAuthenticating}
>
{user ? user.get(âethAddressâ) : â Wallet Connectâ}
)}
What is the error now?
same error
serverUrl is not defined
Try this syntax:
const serverUrl = âhttps://xxxxx/serverâ;
const appId = âYOUR_APP_IDâ;
Moralis.start({ serverUrl, appId });
const serverUrl = âhttp://locahost:1337/serverâ;
const appId = 154;
Moralis.start({ serverUrl, appId });
Is this server running or accessible?
You can also try 127.0.0.1 instead of localhost
Try with chain id as 1 or 0x1
Error: Connecting to chain failed, as no connected chain was found
const chainId = 1;
const { message } = await Moralis.Cloud.run('requestMessage', {
address: account,
// chain: 1,
chain: parseInt(chainId, 16),
networkType: 'evm',
});
is this right?
Error: Connecting to chain failed, as no connected chain was found
showing chained log as 0x1691
You used 1 here and you got that error?
That error is new to me. I didnât see it before.
Maybe the error is related to current connected wallet?
It should sign that message after it gets the message from the cloud function.
it signed in now. Thanks
but the database does show user
What does it happen if it doesnât show a user in the database?
Any error?
Database shows signed address⌠Thank you.
Just one more queryâŚ
the parse server shows domain as defi.account⌠is it changeable? if I have to change it ⌠what domain should I change.
should the chainId should be 1?
You can change that domain to what you want. You can keep that chain id as 1 there. It works the same if is 1 or something else.
ok. I will leave it as 1. Does this version moralis-v1 be there till March 2023 end or any chance that it will be deprecated?
That version 1 will stay there, it is not developed with new features now, only fixes from time to time.
Thank you so much for your patience and help, appreciate your help.