[SOLVED] How top set up parse server in javascript

Please I need help, I am entirely new to this concept of web3 and Moralis. I have a project I am currently working on but it gives me some errors like these

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ā€˜resultā€™)
at send (121212.js:250:28)
send @ 121212.js:250
await in send (async)
proceed @ 121212.js:1299
await in proceed (async)
fetchAccountData @ 121212.js:69
await in fetchAccountData (async)
refreshAccountData @ 121212.js:72
onConnect @ 121212.js:95
await in onConnect (async)
(anonymous) @ 121212.js:1395
Promise.then (async)
startx @ 121212.js:1394
(anonymous) @ bep20.html:132
moralis.js:1367 POST https://pt5gk0drbc2k.usemoralis.com:2053/server/functions/getPluginSpecs net::ERR_NAME_NOT_RESOLVED
dispatch @ moralis.js:1367
setTimeout (async)
xhr.onreadystatechange @ moralis.js:1359
XMLHttpRequest.send (async)
dispatch @ moralis.js:1367
ajax @ moralis.js:1367
(anonymous) @ moralis.js:1380
Promise.then (async)
request @ moralis.js:1379
run @ moralis.js:21
run @ moralis.js:13
(anonymous) @ moralis.js:255
tryCatch @ moralis.js:5225
invoke @ moralis.js:5243
(anonymous) @ moralis.js:5230
asyncGeneratorStep @ moralis.js:1657
_next @ moralis.js:1659
(anonymous) @ moralis.js:1661
Wrapper @ moralis.js:4392
(anonymous) @ moralis.js:1659
(anonymous) @ moralis.js:259
(anonymous) @ moralis.js:431
tryCatch @ moralis.js:5225
invoke @ moralis.js:5243
(anonymous) @ moralis.js:5230
asyncGeneratorStep @ moralis.js:1657
_next @ moralis.js:1659
(anonymous) @ moralis.js:1661
Wrapper @ moralis.js:4392
(anonymous) @ moralis.js:1659
(anonymous) @ moralis.js:431
proceed @ 121212.js:212
fetchAccountData @ 121212.js:69
await in fetchAccountData (async)
refreshAccountData @ 121212.js:72
onConnect @ 121212.js:95
await in onConnect (async)
(anonymous) @ 121212.js:1395
Promise.then (async)
startx @ 121212.js:1394
(anonymous) @ bep20.html:132
moralis.js:1367 POST https://pt5gk0drbc2k.usemoralis.com:2053/server/functions/getPluginSpecs net::ERR_NAME_NOT_RESOLVED
dispatch @ moralis.js:1367
setTimeout (async)
xhr.onreadystatechange @ moralis.js:1359
XMLHttpRequest.send (async)
dispatch @ moralis.js:1367
setTimeout (async)
xhr.onreadystatechange @ moralis.js:1359
XMLHttpRequest.send (async)
dispatch @ moralis.js:1367
ajax @ moralis.js:1367
(anonymous) @ moralis.js:1380
Promise.then (async)
request @ moralis.js:1379
run @ moralis.js:21
run @ moralis.js:13
(anonymous) @ moralis.js:255
tryCatch @ moralis.js:5225
invoke @ moralis.js:5243
(anonymous) @ moralis.js:5230
asyncGeneratorStep @ moralis.js:1657
_next @ moralis.js:1659
(anonymous) @ moralis.js:1661
Wrapper @ moralis.js:4392
(anonymous) @ moralis.js:1659
(anonymous) @ moralis.js:259
(anonymous) @ moralis.js:431
tryCatch @ moralis.js:5225
invoke @ moralis.js:5243
(anonymous) @ moralis.js:5230
asyncGeneratorStep @ moralis.js:1657
_next @ moralis.js:1659
(anonymous) @ moralis.js:1661
Wrapper @ moralis.js:4392
(anonymous) @ moralis.js:1659
(anonymous) @ moralis.js:431
proceed @ 121212.js:212
fetchAccountData @ 121212.js:69
await in fetchAccountData (async)
refreshAccountData @ 121212.js:72
onConnect @ 121212.js:95
await in onConnect (async)
(anonymous) @ 121212.js:1395
Promise.then (async)
startx @ 121212.js:1394
(anonymous) @ bep20.html:132
moralis.js:1367 POST https://pt5gk0drbc2k.usemoralis.com:2053/server/functions/getPluginSpecs net::ERR_NAME_NOT_RESOLVED
dispatch @ moralis.js:1367
setTimeout (async)
xhr.onreadystatechange @ moralis.js:1359
XMLHttpRequest.send (async)
dispatch @ moralis.js:1367
setTimeout (async)
xhr.onreadystatechange @ moralis.js:1359
XMLHttpRequest.send (async)
dispatch @ moralis.js:1367
setTimeout (async)
xhr.onreadystatechange @ moralis.js:1359
XMLHttpRequest.send (async)
dispatch @ moralis.js:1367
ajax @ moralis.js:1367
(anonymous) @ moralis.js:1380
Promise.then (async)
request @ moralis.js:1379
run @ moralis.js:21
run @ moralis.js:13
(anonymous) @ moralis.js:255
tryCatch @ moralis.js:5225
invoke @ moralis.js:5243
(anonymous) @ moralis.js:5230
asyncGeneratorStep @ moralis.js:1657
_next @ moralis.js:1659
(anonymous) @ moralis.js:1661
Wrapper @ moralis.js:4392
(anonymous) @ moralis.js:1659
(anonymous) @ moralis.js:259
(anonymous) @ moralis.js:431
tryCatch @ moralis.js:5225
invoke @ moralis.js:5243
(anonymous) @ moralis.js:5230
asyncGeneratorStep @ moralis.js:1657
_next @ moralis.js:1659
(anonymous) @ moralis.js:1661
Wrapper @ moralis.js:4392
(anonymous) @ moralis.js:1659
(anonymous) @ moralis.js:431
proceed @ 121212.js:212
fetchAccountData @ 121212.js:69
await in fetchAccountData (async)
refreshAccountData @ 121212.js:72
onConnect @ 121212.js:95
await in onConnect (async)
(anonymous) @ 121212.js:1395
Promise.then (async)
startx @ 121212.js:1394
(anonymous) @ bep20.html:132
moralis.js:1367 POST https://pt5gk0drbc2k.usemoralis.com:2053/server/functions/getPluginSpecs net::ERR_NAME_NOT_RESOLVED
dispatch @ moralis.js:1367
setTimeout (async)
xhr.onreadystatechange @ moralis.js:1359
XMLHttpRequest.send (async)
dispatch @ moralis.js:1367
setTimeout (async)
xhr.onreadystatechange @ moralis.js:1359
XMLHttpRequest.send (async)
dispatch @ moralis.js:1367
setTimeout (async)
xhr.onreadystatechange @ moralis.js:1359
XMLHttpRequest.send (async)
dispatch @ moralis.js:1367
setTimeout (async)
xhr.onreadystatechange @ moralis.js:1359
XMLHttpRequest.send (async)
dispatch @ moralis.js:1367
ajax @ moralis.js:1367
(anonymous) @ moralis.js:1380
Promise.then (async)
request @ moralis.js:1379
run @ moralis.js:21
run @ moralis.js:13
(anonymous) @ moralis.js:255
tryCatch @ moralis.js:5225
invoke @ moralis.js:5243
(anonymous) @ moralis.js:5230
asyncGeneratorStep @ moralis.js:1657
_next @ moralis.js:1659
(anonymous) @ moralis.js:1661
Wrapper @ moralis.js:4392
(anonymous) @ moralis.js:1659
(anonymous) @ moralis.js:259
(anonymous) @ moralis.js:431
tryCatch @ moralis.js:5225
invoke @ moralis.js:5243
(anonymous) @ moralis.js:5230
asyncGeneratorStep @ moralis.js:1657
_next @ moralis.js:1659
(anonymous) @ moralis.js:1661
Wrapper @ moralis.js:4392
(anonymous) @ moralis.js:1659
(anonymous) @ moralis.js:431
proceed @ 121212.js:212
fetchAccountData @ 121212.js:69
await in fetchAccountData (async)
refreshAccountData @ 121212.js:72
onConnect @ 121212.js:95
await in onConnect (async)
(anonymous) @ 121212.js:1395
Promise.then (async)
startx @ 121212.js:1394
(anonymous) @ bep20.html:132
moralis.js:1381 Uncaught (in promise) Error: XMLHttpRequest failed: ā€œUnable to connect to the Parse APIā€
at handleError (moralis.js:1381:473)
handleError @ moralis.js:1381
Promise.then (async)
asyncGeneratorStep @ moralis.js:1658
_next @ moralis.js:1659
(anonymous) @ moralis.js:1661
Wrapper @ moralis.js:4392
(anonymous) @ moralis.js:1659
(anonymous) @ moralis.js:431
proceed @ 121212.js:212
fetchAccountData @ 121212.js:69
await in fetchAccountData (async)
refreshAccountData @ 121212.js:72
onConnect @ 121212.js:95
await in onConnect (async)
(anonymous) @ 121212.js:1395
Promise.then (async)
startx @ 121212.js:1394
(anonymous) @ bep20.html:132.

Please help me

Hi can you give more details about your project. That pt5gk0drbc2k server doesnā€™t seem to exist - are you using the correct server URL? Do you have an existing Moralis server?

1 Like

Thanks. The project is to show the token balance of any address.
I donā€™t have any existing server

You can use your own self-hosted server and in your app, you would just switch the server URL and app ID for this server e.g. http://localhost:1337/server.

1 Like

How do I do all these ? Any tutorial to guide me please ?.
Thanks

You can follow this guide.

1 Like

Okay Thanks. But the tutorial is not pointing to how to setup Moralis server in Vanilla Javascript

What do you mean with setting up the server in vanilla JS?
You mean on how to use the sdk v1?

1 Like

This is actually what I want to doā€¦
Check the below snippets of code, How do I get serverUrl and appId ?
const serverUrl = ā€œEnter your Server URLā€;
const appId = ā€œEnter your appIdā€;
Moralis.start({ serverUrl, appId });

I am using Vanilla Javascript

You can not get them easily now. In the last you could create a Moralis server that had those values. Now you will have to self host a parse server if you want to use something similar to how a Moralis server was working.

1 Like

Thanks very much cryptokid for the assistance thus far.
going through the tutorial I encountered a bug, when I run npm run dev I got the following error :

> [email protected] dev
> ts-node src/index.ts

bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?)
warn: DeprecationWarning: The Parse Server option 'directAccess' default will change to 'true' in a future version. Additionally, the environment variable 'PARSE_SERVER_ENABLE_EXPERIMENTAL_DIRECT_ACCESS' will be deprecated and renamed to 'PARSE_SERVER_DIRECT_ACCESS' in a future version; it is currently possible to use either one.
warn: DeprecationWarning: The Parse Server option 'enforcePrivateUsers' default will change to 'true' in a future version.
warn: DeprecationWarning: The Parse Server option 'allowClientClassCreation' default will change to 'false' in a future version.
info: Parse LiveQuery Server started running
C:\Users\user\Desktop\moralis-server\node_modules\parse-server\lib\ParseServer.js:261
          throw err;
          ^

Error: getaddrinfo ENOTFOUND redis-cli
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:72:26)
Emitted 'error' event on RedisClient instance at:
    at RedisClient.on_error (C:\Users\user\Desktop\moralis-server\node_modules\redis\index.js:342:14)
    at Socket.<anonymous> (C:\Users\user\Desktop\moralis-server\node_modules\redis\index.js:223:14)
    at Socket.emit (node:events:390:28)
    at Socket.emit (node:domain:475:12)
    at emitErrorNT (node:internal/streams/destroy:164:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -3008,
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'redis-cli'
}

Node.js v17.3.1

it looks like is it an error related to redis, it expects a redis connection string, try not to use special characters for the password

1 Like

Thanks it has been resolved.
I really appreciate Sir

But I have not achieved what I wanted to do. Please is there any tutorial you can point that does the following in web3.

  • using web3 modal
  • to get wallet address
  • to send tokens.
    Please I would be glad if you can help.
    Thanks

You can make a new topic with these questions.