Don't see logs on the server side when using console.log
This is the first time in my life I touch js or node so please bear with me. I am trying to make my app output logs on the server side. getUser.onclick = function () { console.log('Server running at...
View ArticleStreaming video from S3 with Express/NodeJS to play in Safari
I am using SSE-C encryption for S3 files, so when playing back the video, I am forwarding the request to S3 through the server by attaching params correctly.export default async function(req, res) {...
View ArticleServer side redirect with ReactJs
I am trying to issue a server side redirect for certain pages for SEO reasons. The problem I am trying to solve is that some of my pages will get index by google, so if they are deleted or taken...
View Articlenpm warns about memory leak in a transitive dependency of bcrypt
ContextAfter installing bcrypt, I received several warnings about deprecated packages, but the first one is especially troubling:$ npm install bcryptnpm WARN deprecated inflight@1.0.6: This module is...
View ArticleError: WHERE parameter "id" has invalid "undefined" value
I'm making an API with Express.js and Sequelize for an appointment scheduling app. So far I have two models, User and Salon, with an N:M relationship. (So an user might manage many salons, for a...
View ArticleError: querySrv ENOTFOUND _mongodb._tcp.dbname.fzofb.mongodb.net
I'm learning Node.js and just started working with MongoDB.I'm making a connection with the MongoDB Cluster I've createdconst dbURI =...
View ArticleHow to autogenerate API documentation from Express route mappings?
I am developing a REST API in nodejs + Express and I have been simultaneously documenting my API in the README file and I was wondering if it is possible to automate it. e.g. given:app.get('/path/to',...
View ArticleCase-insensitive queries with Amazon Dynamo DB
In In DynamoDB, string values are case sensitive. In my app, users can search the db for a profile name. However, if they searched for, say 'alan', then 'Alan' would not be returned in the search...
View ArticleHow to set up an update route in Express
I am building a MEVN stack CRUD app (Vue, Node, Express, MongoDB). I am attempting to set up the following Express route for my app...postRoutes.post('/update/:id', async(req, res)=> { const...
View ArticleNodeJs : How to send very large data from server to client
I am using Express Framework. I am trying to send very large data from server. The Client receives 200 OK status but no data. Also it gives error ERR_CONTENT_LENGTH_MISMATCH even though I am sending...
View ArticleCannot find module: internal/modules/cjs/loader.js:969
I wanted to run my app and I suddenly got this error. Why?this is what my order looks like in which i work../├─ app.js├─ .env├─ .gitignore├─ node modules/│└─ ...├─ package.json├─ package-lock.json├─...
View ArticleHow to get all registered routes in Express?
I have a web application built using Node.js and Express. Now I would like to list all registered routes with their appropriate methods.E.g., if I have executedapp.get('/', function (...) { ......
View ArticleUnexpected token '
For the past few days, I have been attempting to solve this error. I am extremely baffled, as I have no idea why this isn't working. Any help or suggestions would be greatly appreciated.When I attempt...
View ArticleHow to add custom message on Zod tuple?
I want to return a custom message on a Zod tuple. I did not find any way to do that.Returned message:Array must contain at least 4 element(s)Code:z.tuple([ z.enum(), z.number(), z.string(),...
View ArticleTypeError: Cannot read property 'access_token' of undefined
I am creating a discord bot dashboard website with express and i've been getting this error but can seem to fix it: TypeError: Cannot read property 'access_token' of undefined. When I run the code...
View ArticleNodeJS only listens on localhost
I have developed a NestJS Server application. NestJs is a node server running with express written in TypeScript. Now I want to deploy the application on my rapsberry pi. However, I'm only able to...
View ArticleRetry async/await try and catch block three times before responding with an...
Found similar issues, but none of which answered my question. I need to try to run an async function three times before throwing an error. Currently doing it with a while loop doing, which doesn't feel...
View Articlehow to increase memory heap in nest.js application ? how to use...
I am working on node.js project with nest.js framework and I had the error "JavaScript heap out of memory"my question is how to allocate more memory to my app?. Also I found some people say that I...
View ArticleWhat is routes/index.js and its purpose?
What is the purpose of this file? Is this where 'all' the get and post calls get instantiated?If so, wouldn't this be a very huge file when working with large scale projects?I've tried calling a post,...
View ArticleHow to fix the issue as: "at process.processTicksAndRejections...
I want to send a token back to the user to reset his password, but I am getting this error:Error: there was an error sending the email, try again laterat exports.forgotPassword...
View ArticleGoogle Sheet integration in Express JS
How can I create a feature in Express JS where users can authorize their Google account with our app. So, we can fetch the google sheet from their accounts and show it in my express app, and if users...
View ArticleRequest body undefined in express
When I log the request body in the application it gives me undefined. I read it usually is for bodyparser; I tried to add it but it remains undefined.import express, {type Express, type Request, type...
View ArticleStore session data using MemoryStore in Node, similar to $_SESSION['data'] =...
Question:Is it possible to store session data similar to $_SESSION['somedata'] = "Hello" in php?Here is my code so far:Creating the memory storevar MemoryStore = express.session.MemoryStore,...
View ArticleWhy I can't import .ts file using express and typescript [closed]
I am tryng to import a controller with .ts extension but i am having trouble.I exported with export const registerWhen i import the controller with .ts extension i am getting an error.I imported the...
View ArticleExpress - Session mismatch, user ends up on other user
Have a major problem that user sometimes ends up on wrong user.Have the following setup in app.js. var session = require('express-session'); var RedisStore = require('connect-redis')(session); var...
View Articletypescript error - cannot find name 'process'
I am setting up a new project with express+ typescript and facing typescript error - cann't find name 'processs'package.json"dependencies": {"express": "^4.16.4","nodemon": "^1.18.7","tsc":...
View ArticleHow can I scan an S3-compatible object storage file with VirusTotal API using...
I am trying to scan an image for viruses using the VirusTotal API.The image is stored in an S3-compatible object storage (Backblaze B2), and I am using the AWS SDK for JavaScript to retrieve the...
View ArticleHow to solve : Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they...
I have a node/express server code asindex.jsconst express = require("express");const Room = require("./models/room");const roomRouter = require("./routes/room");require("./models/db");const cors =...
View ArticleRunning the node-express app live in render.com with query throws internal...
I'm trying to run a route live with query using nodejs express app in render.com. All other routes related to the crud operations are getting executed except the search filter route url with the...
View ArticleDeploying to vercel
Hello i'm having issues deploying my website/app to vercel. It's a node/express backend and a create-react-app front end.I should start by saying that localy everything works perfectly.As for...
View Article