Category "node.js"

Correct way to pass multiple values for same parameter name in GET request in javascript or nodeJs

I wanted to write the response like this using nodeJs: http://server/action?id=a&id=b Or http://server/action?id=a,b

"No routes matched location" error in React

I am creating a React app which can be used to manage company events. There are two components related to events that aren't working at the moment. These are th

Import.meta.env undefined on production build vitejs

I am using vitejs to compile my react app statically, however after build .env imports become undefined which is not the case on development stage. reading the

Truffle migrate and truffle install error

I keep getting this error. When I try truffle migrate --reset node:internal/modules/cjs/loader:936 throw err; ^ Error: Cannot find module 'C:\Users

How can i realize http-streaming of kafka messages to endpoint on Nodejs?

I've been trying to realize stream kafka messages by get endpoint on client side using http-streaming. Thats my kafka consumer, where i recieve messages from pr

CORS error with OPTIONS request using AWS CDK

I am using AWS CDK to run a RESTful API and I am getting the following preflight error when calling a POST endpoint: Access to fetch at 'http://localhost:4000/

How do I design my NodeJS app to have one config (per env) that can work for both K8S and locally in debugger?

I've been using K8S for a year or so and continue to revisit a problem. My app is running in K8S and I now need to debug it. I have a NodeJS App that I'm askin

Jest + Supertest - API tests are using random ephemeral ports

I'm using Restify for my API and I'm trying to write tests for my endpoints. At first, I had only a test for ping and it was okay, but now, after I added a new

Ineffective mark-compacts near heap limit Allocation failed error when building next.js app

I have a next.js app running inside a docker container in a EC2 instance. When I run docker-compose up this will trigger the next.js app to be built. Now it is

Difference between NodeJs preload option (-r) and explicit require in in REPL

I'm using esm which is a very useful package to support ES import keywords. According to the doc, in REPL, it can use preload command-line option to initialize

Jest spyOn with uuid breaking in 8.x

I have a jest spyOn with the uuid which was working in the version 3.4.0 after upgrading it to 8.3.2 the test breaks with the error Cannot spyOn on a primitive

Nodejs Axios Error: Hostname/IP doesn't match certificate's altnames: "Host: (URL). is not in the cert's altnames: DNS:*.sa-east-1.es.amazonaws.com"

I'm trying to request an API from a third party server from a shared hosting server, so i don't have root access, and receive this error, but when i try it from

Error when installing necessary packages on Node js

I was installing Node.js on Windows. It installed successfully, and I also selected the option to install necessary files (such as chocolatey) in the node.js in

Error response from daemon: failed to create shim when installing Nodejs

I am trying to create a docker image with node.js version 16. However I failed to find solution to this problem despite searching stackoverflow and other platfo

My delete function will not work using react frontend but backend are okay its working

I'm new to React. I am working on a react application that communicates with a MYSQL database. When i open the application I get a list of all the students who

How to solve Node mon crashing problem when connecting mongo DB using NodeJS

Node mon app crashing problem when connecting Mongo DB using Nodejs

TypeScript/Eslint throwing a 'Promise returned' error on a Express Router async route

I have the following endpoint setup to reset a database after test runs: import { getConnection } from 'typeorm'; import express from 'express'; const router =

Uncaught Error: Type HttpClient does not have 'ɵmod' property

I'm creating a news app referring this link https://www.youtube.com/watch?v=D8J9QUwTWmU&t=3s&ab_channel=CodeXpression getting error while checking it fi

How to remove schema validation in mongoose (mongodb)?

I have MongoDB server version: 5.0.6 installed and used "mongoose": "^6.0.14" to create a model validation. Example of model: const User = new Schema({ name:

react js send object to node js

I send the object to the backend(Node js) when API call. but I check objects using console log. I checked using POSTMAN. When I checked POSTMAN, I worked very w