Ask coding questions

← Back to all posts
Node.JS Replit Database Not Working
MartiaForoud (55)

Whenever i use the IDE terminal, the project works just fine, but when i try to input the address in the address bar, i get this error:

    at getNodeRequestOptions (/home/runner/txqkaiacxo9/node_modules/node-fetch/lib/index.js:1305:9)
    at /home/runner/txqkaiacxo9/node_modules/node-fetch/lib/index.js:1410:19
    at new Promise (<anonymous>)
    at fetch (/home/runner/txqkaiacxo9/node_modules/node-fetch/lib/index.js:1407:9)
    at Client.get (/home/runner/txqkaiacxo9/node_modules/@replit/database/index.js:20:18)
    at /home/runner/txqkaiacxo9/index.js:22:12
    at Interface._onLine (readline.js:327:5)
    at Interface._line (readline.js:658:8)
    at Interface._ttyWrite (readline.js:1003:14)
    at ReadStream.onkeypress (readline.js:205:10)
(node:44) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:44) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
Answered by Coder100 (17111) [earned 5 cycles]
View Answer
Comments
hotnewtop
Coder100 (17111)

I created the database, looking into it rn

Coder100 (17111)

it's a terminal application so the replit database URL could not be found, it's a super bad bug and you should report it here @MartiaForoud

MartiaForoud (55)

@Coder100 Also i can help on your hide&seek socket.io

Coder100 (17111)

im currently using vsCODE, do you have that? @MartiaForoud

Coder100 (17111)

AWESOME
do you have live share? I'll send link @MartiaForoud

MartiaForoud (55)

@Coder100 What's it?
Gimme a link to it, also This is my discord tag: Mforoud86#5928

Coder100 (17111)

also mark as correct answer? @MartiaForoud

Coder100 (17111)

I got it!
What happened is that this is a terminal application. This means 2 things:

  • repl.it DB does not work (yet, hopefully)
  • .env files and secret keys remain too secret and can't even be accessed.