Category "node.js"

GraphQL + ReactJS throws Error 400: Bad Request

I've been stuck at trying to submit my form for a couple of days now. I constantly get hit with the following error: "POST http://localhost:5000/graphql 400 (Ba

Uncaught errors by .catch clause in Promise for JSON HTTP request

I have this function that collects JSON data from an API endpoint: export const getDataAPI = (token_id) => { const url = `https://api.url.com/tokens/` +

My browser sends fetch data request continuously and it gives pending status after giving 200 several times in react

I'm trying post some data in mongodb database and it works perfectly until the fetch request is sending continuously even if I didn't do anything. In the networ

product validation failed: describtion: Path `describtion` is required., name: Path `name` is required

when open seed page i get "product validation failed: describtion: Path describtion is required., name: Path name is required." instead of "seed opened", how I

Discord.js Send a message every X seconds with Client.on('ready', () => { });

I would like to send a message every X seconds and that the user who reacts first gives him 10 coins. The problem does not come from the system of coins, it is

File download freezes and does not finish on linux

I'm using "Node.js", "express" and "SheetJS" so that an endpoint that saves the data (from an array of objects) in an XLSX file and returns the url of the file

Why i can't import "os" modules with "import" syntax?

With my node(v16.13.2) const os = require("os"); this is perfectly work. But import os from "os"; This gives me an error that Module 'os' has no default expor

Do JSON-Web Tokens (JWTs) cover both authentication and authorization?

I am researching on how to create a blog website that allows a user to sign in and based on his/her user role they can edit blogs, delete blogs, etc. but only i

Sending a message from one Websocket connection another existing Websocket connection from another server

I am new to WebSockets and NodeJS and experimenting with realtime chat application using NodeJS and WebSockets. Here I try to understand how I can scale my appl

What could be the reason for the status code 503 Service Unavailable

I am running an Ubuntu server (DigitalOcean droplet) with 2 services. React (Create React App) frontend in PORT 3000 and Node.js backend/API in PORT 8765 with P

How to display Mongo data in Front End in MERN

I am working in MERN Stack and i am stuck at a part where i have to display the data of MongoDB compass on the Web page in a designed way i am able to display a

Is connceting Node JS to database sufficient while developing an app on react native?

I am doing a project and am very new to coding, while developing an app i want to connect my app to Postgresql database. So, is connecting to Node JS sufficient

How to Solved Heroku Argument passed Error?

BSONTypeError: Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer at new BSONTypeError (C:\projects\assignment-1

moment.IsSame returning wrong result

I am using the moment isSame which is returning false for two dates which are same, moment(new Date('2070-07-27T21:59:59.999Z')).isSame(moment(new Date('2070-07

React app using Cloudflare Pages: error [email protected]: The engine "node" is incompatible with this module

When I deploy a React app using Cloudflare Pages, the Building application step fails with the error: error [email protected]: The engine "node" is incompatib

Promise returns undefined nodejs

i am back with a same issue for my promise returning undefined please help. Here, i am using ipfs to save data with savedata() which takes in a json string,a do

PostgreSQL subqueries as values

I am trying to use a postgreSQL INSERT query with a subquery as parameter value. This is to find the corresponding user_id from an accompanying auth_token in us

Minimax algorithm doesnt go for mate in chess

My goal is to code a somewhat OK chess engine, in the following position it's a mate in 2 which the engine should easily find with its depth of 4-5. The first

How to copy a file in node.js?

I'm learning Node.js and using the Hyper Terminal and Visual Studio Code. I want to copy a file through Hyper Terminal and notice that const fs = require("fs");

How to Implement Google Cloud Vision Api to React Application

I am trying to connect my node.js Google Cloud Vision API with my react application that I've created, but I'm running into several errors compiling when I run