All Questions
77,728
questions
1
vote
0
answers
11
views
Nodemon Crashes with 'bad ELF magic' Error on Termux in Android
I'm using Termux on my Android phone to run a simple Node.js server with nodemon. My server script (index.js) is written in JavaScript and should work fine, but when I run it with nodemon, I get the ...
0
votes
0
answers
9
views
405 Error or 401 Error (sometimes) on Stripe Endpoint with Next.js, Vercel, and PM2: Unable to Create Checkout Session
I'm integrating Stripe into my Next.js application deployed on Vercel. The goal is to create a checkout session through a POST request to the /api/stripe/create-checkout-session endpoint. However, I'm ...
-1
votes
0
answers
21
views
how to prevent duplicate keys into database with mongodb and expressjs
i am working a crude project with mongodb expressjs and pug(formerly knone as jade) i am stuck on preventing duplicate keys both on Front-end and backend.
this is what i did....
let mongoose = require(...
-2
votes
0
answers
31
views
HOW to improve this node express server code and its code ? and how to improve the recurring notification api [closed]
Title: Why is my API endpoint not pushing FCM notifications with schedule?
Body:
I'm working on a Node.js/Express API endpoint to schedule push notifications using Firebase Cloud Messaging (FCM). ...
0
votes
0
answers
20
views
Error [ERR_INSPECTOR_NOT_AVAILABLE]: Inspector is not available, while using vercel/pkg and pm2 in nodejs
I have a NodeJS CLI application built using commander, I am using vercel's pkg to create executables.
Now, I starting a localserver using express on a particular command like this:-
program
....
1
vote
1
answer
32
views
Separating routes into different modules
I've been putting my all routes into one server.js file, after a while i realised there is about 1000 lines in one file and it is hard to manage it. The question is there a simple way to seperate ...
-1
votes
0
answers
19
views
How can I implement a shareable link feature for notes in a simple notepad web app? [closed]
I’m building a simple notepad web app called Bloco de Notas Online where users can create and save notes. I want to add a feature that allows users to generate a shareable link for their notes. The ...
0
votes
1
answer
24
views
Retrieving a Single Numeric Device ID from a Mongoose Schema
How can I retrieve the deviceId as a single numeric value in my Mongoose schema and Express.js controller?
I'm using Mongoose with Express.js to save car records, and I've defined a deviceId field as ...
-1
votes
1
answer
26
views
How do I display loading screen while EJS is rendering content
I'm making website using NodeJS, Express JS and EJS. In some pages, they need to execute lots of database queries and it should take long time. I want to display loading screen during this time, ...
0
votes
0
answers
40
views
Node js error Streaming Application in Node [closed]
node:internal/modules/cjs/loader:1228
throw err;
^
Error: Cannot find module 'express'
Require stack:
- C:\Users\Khan\Documents\project 7\index.js
(node:internal/modules/run_main:174:12) {
code:...
-1
votes
0
answers
19
views
Google Auth2.0 API rejects with IdentityCredentialError: Error retrieving a token
I'm using Google Auth 2.0 with a React frontend and ExpressJS/Node backend. I am trying to send an email using NodeMailer, but first I have to authenticate the user using the Google Auth 2.0 service.
...
-2
votes
0
answers
9
views
building a monitorng screen for multiple node scripts [closed]
I have multiple node tasks running concurrently. Each uses express to display a browser status page with different counters and metrics.
How can I build one main screen that will show info from all of ...
-2
votes
1
answer
83
views
What this mean : "TypeError: Cannot read properties of undefined (reading 'toLowerCase')" [closed]
When I submitting answer then this line apprise in page and console:
TypeError: Cannot read properties of undefined (reading 'toLowerCase')
at file:///***/index.js:48:31
Here is my code :
app.post(&...
-4
votes
0
answers
26
views
Node js cancel request when user leaves page [closed]
When a user goes into a page it makes some requests, etc. to load data for a table, or in a dashboard to load multiple information.
Is there a point to detect if the user has left the page in order to ...
0
votes
0
answers
39
views
Express js module not found error and node modules files not creating
I ran the npm init command in the folder I was working in. Then, I ran the npm install express command. Two files named package-lock.json and package.json were created in my folder, but the ...
1
vote
1
answer
62
views
Fetch request does not work with expressJS server (but both are working fine)?
I have a fetch request in a server component in a NextJS app. It looks like that (I tried to reduce all code to minimum working example) :
export async function bookRoom(params: BookingRequest) {
...
-3
votes
0
answers
38
views
API to create recurring notifications in Firebase node express [closed]
Title: Why is my API endpoint not pushing FCM notifications with schedule?
Body:
I'm working on a Node.js/Express API endpoint to schedule push notifications using Firebase Cloud Messaging (FCM). ...
0
votes
1
answer
41
views
why does it open with any pass after i use the correct password once? [closed]
I have 2 HTML files, one with just a form(which takes in a password) and one with secrets. I wrote this js code but when I run it, it refuses every wrong password until I put the correct password once ...
0
votes
0
answers
18
views
Unable to implement mfa in Supabase
I am using supabase to implement MFA in my auth but always encounter "Missing Sub Claim error"
I use custom claims during signup to store mfa status and factor ID during mfa enroll during ...
-2
votes
0
answers
10
views
Toolforge hosted server stopped by UID = 0 PID = 0 [closed]
Each times it reaches the oauth callback url it shows this message:
The web service for this tool is running but cannot be reached. Please check the error logs of your web service.
And the error log ...
0
votes
0
answers
27
views
Error if refreshed from any other page (or route) other than "/" in react application created with vite@latest (Under deployment on Vercel)
I have developed a single page react app using vite@latest, my problem is that: If I refresh from the "/" page (or route) then nothing goes wrong, BUT if I refresh from a page(or route) ...
0
votes
1
answer
23
views
Node Express server returning EADDRNOTAVAIL error when trying to host on 192.168.0.90:3000
when trying to run:
app.listen("3000", "192.168.0.90", () => {
console.log(`Server running at http://${hostname}:${PORT}/`);
});
it returns the error:
Error: listen ...
0
votes
0
answers
19
views
Requests not being forwarded via corporate proxy
I've put together an ExpressJS proxy server, that uses http-proxy-middleware to make the request to the destination that we want to go to. The proxy server works fine, but only when I'm working from ...
0
votes
2
answers
32
views
ExpressJS res.render is not a function
I've searched on google but not yet found an answer so I write here. I am new in ExpressJS so this is my first Express application.
Here is my router:
loginRouter.post('/login', loginController.index)
...
0
votes
2
answers
27
views
GoogleApis - JavaScript heap out of memory
I am building a service that integrates Google Apis using NodeJs with Express.
Everything works fine on my local environment, but when I try to deploy it to my EC2 instance, I get a JavaScript heap ...
-4
votes
0
answers
41
views
Angular Nodejs Incorrect Login or Password
I'm trying to figure out the best way to handle login(incorrect username or password).
When user logs in I do my authentication on server side which works the way it is suppose to, if incorrect ...
-1
votes
0
answers
21
views
passportjs + googleoauth20 + express-session (valkey store optional) req.user undefined
I'm so tired i spent the whole day trying to fix it but no matter what i do it's not working all i get is undefined PLEASE PLEASE HELP!!!!
I Uploaded All The code On GitHub
https://github.com/Parag-47/...
-3
votes
0
answers
26
views
Does sequelize sanitize enough inputs? [closed]
I was wondering since I use Sequelize for all my queries. Should I even bother sanitizing inputs since Sequelize handles that?
If yes, In what specific I do need to sanitize the inputs? And since I'm ...
0
votes
0
answers
34
views
No 'Access-Control-Allow-Origin' header is present on the requested resource Error while fetch works fine during login with the same cors options
I'm trying to send a post request to my server using fetch but it is constantly getting blocked by cors policy. However when I used fetch during user login, it was working fine. And this issue popped ...
1
vote
1
answer
19
views
GraphQLError: Syntax Error: Expected Name, found "}"
Creating an application using various tech stake. first time using garphQl in my project.
I am getting this error and not know how to solve this error. I have try various chatbot support, stack ...
-1
votes
0
answers
32
views
Node.js Application Runs on All Domains, How to Restrict It to Only One Domain
I am running a Node.js application, and it is currently running on all domains on my server. However, I want it to run only on a specific domain. It should not be accessible from other domains.
My ...
0
votes
0
answers
19
views
ForbiddenError: invalid csrf token at doubleCsrf
First off, sorry this is a re-upload. reason being is I'm an idiot...
I'm creating a dummy social media app using express JS and Mongoose. I tried to implement sessions and CSRF protection but I am ...
0
votes
0
answers
34
views
Slow chunk file Upload Speeds with Nginx and Node.js Despite Low Server Resource Usage
I've been struggling with slow upload speeds when handling file
uploads through an Nginx reverse proxy to a Node.js (Express)
backend. Despite the server having plenty of resources available (low
CPU ...
0
votes
3
answers
55
views
Request with express hangs
I have the following code:
export default class Server {
private app: Express;
public port: number = 3000;
constructor() {
if (!isNode) {
throw new Error("The server must be ...
-3
votes
1
answer
31
views
I get a 'Cannot GET' error in express project [closed]
Getting cannot GET error while trying to access a url
I was making a simple node.js express project and doing login and register urls, but I can't access them
This is my routes/users.js file:
const ...
0
votes
1
answer
32
views
Mongoose Validation Error on lastUpdated Field Despite Setting It Before Save
I'm running into a bit of an issue with Mongoose in my Node.js/Express application, and I would greatly appreciate your help. The problem occurs when I try to update a Restaurant document in MongoDB. ...
-2
votes
1
answer
48
views
How to fetch data from my mongodb database to my frontend [closed]
Please, I'm a beginner and I'm trying to run a blog site using Node... I've been trying to write a code to fetch data from my MongoDB database to my frontend using nodejs, express, ejs and mongoose ...
0
votes
0
answers
42
views
CORS issue when connecting frontend and backend on different domains in production (Hostinger) without VPS
I'm staring to get involve in Software development. I’m working on deploying a web application where the frontend and backend are hosted on different domains. I’m using shared hosting on Hostinger and ...
-1
votes
0
answers
25
views
NodeJs server becoming unresponsive [closed]
I'm running a Node.js server using PM2 in cluster mode on a machine with 8 cores. Occasionally, the application becomes completely unresponsive—no logs, no responses, nothing.
I've integrated ...
1
vote
1
answer
67
views
How to run logic the first time a route is accessed in Express.js?
I'm using Express.js, and I want to initialize a cache on every initial request to a route, and on the subsequent ones use the cached value.
For now, I do something like this:
let hasRun = false;
app....
0
votes
1
answer
46
views
How to simplify this DEV script for faster running Express with GraphQL with Prisma
"dev": "export NODE_ENV='development' && DEBUG=*,-babel-watch:*,-babel,-babel:*,-express:*,-nodemon,-prisma:*,-prisma:client:*,-body-parser:json,-nodemon:*,-babel-watch:*,-...
0
votes
0
answers
32
views
Unable to add id in URL request through req params
I want to retrieve product by id from server in mongoose but req.params.id is not working.
I replaced req.params.id with id number to see if there is any other problem but it worked fine.
Here is the ...
0
votes
1
answer
39
views
How can I configure Google Cloud Run and sharp so that my generated images contain text instead of boxes?
I've built a service using Node.js & sharp that composites some text onto a background image:
exports.social_get_result = async function(req,res,next){
// Path to the existing background image
...
0
votes
0
answers
26
views
POST API calls are failing due to ERR_CERT_CPMMON_NAME_INVALID error occurred during HTTPS reverse proxy setup wth IIS [closed]
POST API Calls are failing due to ERR_CERT_CPMMON_NAME_INVALID error occurred during HTTPS reverse proxy setup with IIS
The API calls should be successful with https. How to setup reverse proxy in IIS ...
-1
votes
0
answers
23
views
Changing password with bcrypt [closed]
I have got some issues about bcrypt is that changing password.
Users.js
import Users from "../db/users";
import ApiError from "../errors/ApiError";
import bcrypt from "...
0
votes
0
answers
23
views
How to limit file size in multipart uploads to R2 bucket using Node.js?
I'm working on a Node.js application that allows users to upload files to an R2 bucket using multipart uploads. I want to restrict the maximum file size that users can upload to 200MB.
if(req.body....
0
votes
1
answer
41
views
Cast to ObjectId failed for value (array) at path (pathName) because of BSONError
Not sure if i did wrong, but I'm trying to POST an array with ObjectIds into a model with the type being ObjectId (see model), and it just returns
"Cast to ObjectId failed for value "['...
0
votes
0
answers
28
views
Why is my fetch endpoint method seemingly not finishing? [duplicate]
So in my code, I have this function handling the clicking of a button. However, it seems like there is some problem holding up the fetch() function, since the "1" at the end never gets ...
0
votes
0
answers
29
views
Translate PDF while preserving the layout in Nodejs [closed]
Problem Statement:
Hi everyone, I was trying to find a solution for translating pdf while preserving the layout of the PDF. Currently I'm using pdf-parse package to parse the content of PDF, pdf-lib ...
-1
votes
0
answers
26
views
Printing PDFs Server Side
I am building a feature in my app where I have to let users only print a pdf but they can not download it to their pc. Using window.print() or any client-side library ( which they all I believe call ...