94,958 questions
-5
votes
1
answer
78
views
How to store images in MySQL hosted in Hostinger thorough Nodejs?
I want to store images in Database. My database is hosted in hostinger and my whole website is hosted in hostinger.
I have tried with this code.
const express = require("express");
const ...
0
votes
0
answers
91
views
When submitting data through an EJS form, all data get returned as "undefined"
I'm currently trying to make a login and signup form using EJS, Express, Node, etc. However Whenever I submit data from a form, all data is being returned as "Invalid"
I've checked my user ...
0
votes
0
answers
33
views
ReferenceError: normalizedWhisper is not defined in whisper update test
I'm currently learning about testing with Jest, and there's one test in an 'it' block that's failing. The issue happens when I try to update a task, but the task doesn't have an ID (it's null).
I'm ...
0
votes
0
answers
44
views
Running "Exec' Child Process Second Time Crashes the Nodejs App
I am running a bash command using nodejs child_process exec function. I start the app and execute the shell, and it works successfully. It's an expressjs app running with nodemon.
But on second time ...
1
vote
0
answers
180
views
How to Display Zod Validation Errors in Swagger with zod-openapi?
I've made an error handler middleware in Express. The problem is that the error is not being thrown in the openapi/swagger. How to fix it? Also why am I getting an error if my request body is ...
0
votes
1
answer
48
views
express.static not kicking in on file requests
So I have an express server set up to serve static content with express.static, some api routes and a last "failsafe" app.use('*'...) to serve the angular index.
My issue is any /file.ext ...
0
votes
0
answers
17
views
Error: Failed to lookup view "../layout/base.ejs" in views directory "C:\Users\admin\Desktop\app\views"
Issue with Express view rendering in /products route
Folder Structure
app/
├── src/
│ ├── controllers/
│ │ ├── authController.ts
│ │ └── productsController.ts
│ ├── models/
│ ...
0
votes
0
answers
21
views
Handling nested entities in a Express JS REST API and typeorm
I have two (typeorm) entities: Book and Author. An Author can have one or more Books.
The API has an endpoint to retrieve an author by id (/api/authors/:authorId):
the AuthorController has an ...
0
votes
0
answers
56
views
Cookies don't get stored in browser after deployment using ExpressJS and NextJS
I am building a full stack app using ExpressJS for the backend and Next.js for the frontend.
The app is working fine when running locally on localhost. When I try to deploy on Vercel, it doesn't store ...
-1
votes
1
answer
86
views
Node / express / ejs / Uncaught SyntaxError: missing ] after element list
I'm running a express server and render a list.
This is the code of the route:
try {
let result = await servCollections.prepareDataForListCollections();
let colls = result.data;
let ...
0
votes
0
answers
30
views
serve static files through proxy server
I am using a proxy server named proxyserver.com, that proxies links to a local network server localserver.
All the links starting with proxyserver.com/foo are proxied to localserver/foo.
In my ...
1
vote
0
answers
13
views
Electron Error running server node js where packaging
i have a problem to connect with server when using electron builder so i guess the electron cant find the server file server.js
in the root there is client server folders and main.js package.json
main....
0
votes
0
answers
26
views
Why is res.clearCookie() clearing cookies in Postman but not in the browser? [duplicate]
I am trying to clear a cookie named token in my Node.js Express app using res.clearCookie(). The cookie clears successfully when I test the API using Postman, but it doesn't clear when I test it in ...
-1
votes
1
answer
75
views
Access to XMLHttpRequest from Origin Localhost Blocked by CORS Policy | ExpressJS
I have an expressjs app behind nginx server already importing and using cors module.
var express = require("express");
var cors = require("cors");
var app = express();
var ...
0
votes
0
answers
39
views
Sequelize findOrCreate() creates duplicate Terms and Listings
Consider the following models and the following post method:
router.post("/", async (req, res, next) => {
const {
address: addressData,
building: buildingData,
items: ...
1
vote
0
answers
61
views
Argon2 always returns false
I create a user on the login page and hash this password with Argon2 but when I compare it, it does not match the password. The hashed password is shown in the database and I can also see the plain ...
0
votes
0
answers
55
views
Upload Progress Not Working with Nginx and ExpressJS
I have a simple expressjs app set up behind the Nginx server to take requests to upload the files.
When uploading files without Nginx server, the upload progress is obtained through XMLHttpRequest ...
0
votes
0
answers
40
views
Data Leakage issue when caching multiple sequelize instance
When I cache multiple Sequelize instances while sharing the same models (entities), the last cached instance in memory overrides the Sequelize instance of the models from the previous cache.
for ...
0
votes
0
answers
78
views
Cpanel require () problem for node js using ES module
i have been trying to deploy a Node js app built using ES module in CPANEL but whenever i run the server i get this error from require
Node.js v20.18.2
/usr/local/lsws/fcgi-bin/lsnode.js:48
var ...
0
votes
0
answers
59
views
serving static files with a proxy server
I have an apache server that is reachable from outside my local network, named interfaceserver.com.
I also have an express server in my local network, named localserver.
In apache configuration of ...
2
votes
2
answers
222
views
When in development mode, unable to GET bundle.js file, fails with 404 Not Found [closed]
While trying to run the application locally, browser is not able to load bundle.js:
This is the setup to load bundle.js inside index.html:
<script type="text/javascript" src="/...
0
votes
0
answers
33
views
Deleting Files from Autodesk Viewer
I want to be able to delete files from the Autodesk Viewer. When I delete them - I want them to disappear from my dropdown and not appear as "Model not translated".
I was using the code from ...
0
votes
2
answers
113
views
HTTPS On Frontend and Backend Not Working
I'm trying to test HTTPS on both my frontend and backend environments locally.
On the UI, I'm using Nextjs and am able to easily add HTTPS to my environment using the --experimental-https parameter ...
0
votes
1
answer
77
views
passport.serializeUser & passport.deserializeUser not working
I try to do a login via a LocalStrategy in Passport, but the serializeUser and deserializeUser functions don't seem to be called at all. The versions of the ‘Relevant’ packages are:
"express"...
0
votes
0
answers
97
views
I am trying to render a video to my react native mobile app but it come up as blank
const renderPost = ({ item }) => {
const mediaUri = `http://10.50.99.238:5001${item.media_url}`;
return (
<View
style={{ padding: 10, borderBottomWidth: 1, borderBottomColor: &...
0
votes
1
answer
50
views
Custom Express Middleware resulting in TypeError: app.use() requires a middleware function
const ErrorHandler = (err, req, res, next) => {
logging.error(err);
let message = 'An error occured, please try again.';
let statusCode = 500;
const response = {
success: ...
1
vote
0
answers
416
views
context deadline exceeded (Client.Timeout exceeded while awaiting headers)
At the moment I'm building an API on Express.js with ts-node. At first 30 mins - 1 Hour everything works fine, but after a couple of hours I'm starting getting error context deadline exceeded (Client....
0
votes
2
answers
70
views
post route is not working in my express js project
Here is the code for the index.js of my expressjs project. I'm new to Node.js and trying to understand how to develop a web app using MERN Stack.
import express from "express";
import ...
0
votes
2
answers
109
views
Could not find a declaration file for module 'cookie-session'
I have a Typescript project and I get the following error.
[auth] [ERROR] 09:55:34 ⨯ Unable to compile TypeScript:
[auth] src/app.ts(3,27): error TS7016: Could not find a declaration file for module '...
0
votes
2
answers
69
views
NodeJS cookie settings (HTTPS, saveUninitialized) fail to apply
I set cookies in NodeJS with the following code:
const session = require('express-session');
const MongoDBStore = require('connect-mongodb-session')(session);
const max_session_ms = 365 * 24 * 60 * ...
1
vote
1
answer
43
views
{{each}} block not working under HBS block helper
I set up a simple form input page where after submitting the form, the same form data would be displayed as entries under.
const express = require('express');
const router = express.Router();
const ...
0
votes
0
answers
38
views
Storing and fetching multiple images for a blog app made using MERN stack
I was making this application using MERN stack. But what I want to know is, how are multiple images persisted in my mongoDB atlas, and how do I fetch them sequentially. I came up with an idea to store ...
0
votes
0
answers
36
views
Socket IO Invalid WebSocket frame: RSV1 must be clear ( permessage deflate )
require('dotenv').config();
const Agent = require(`./Models/agentModel`);
const logger = require(`./logger`);
const adminRoom = 'admin-room';
const socketapi = {
io: null
};
function setupSocket(...
0
votes
0
answers
65
views
How can I set a CSRF cookie as a server cookie in NextJS to send it to ExpressJS backend?
About my architecture:
I have a backend with Express.js and a frontend with Next.js.
I have massive problems with my CSRF cookie. I create it in Express.js and send it to Next.js (Client). Here it is ...
0
votes
0
answers
29
views
ErrorHandling in N-Tier ExpressJS Applications
Say the following layers
controllers try { } catch ()
business (services) try { } catch {}
database (repository) try { } catch {}
suppose when a exception occurs in database layer caught in catch ...
1
vote
1
answer
52
views
Netlify app can't login to Express app only on mobile
I have a Vue 3 app hosted on Netlify, and the backend is hosted on Heroku. The login is a simple /login endpoint made with Express and Sequelize. It works well on desktop, but when I try to log in on ...
0
votes
1
answer
80
views
How to continue in case of the router is not satisfied using http-proxy-middleware?
I have a node.js / express project and I try to implement http-proxy-middleware like this :
const app = express();
...
// 1st : `/mainUrls/*` are processed by the main app
app.use("/mainUrls"...
0
votes
0
answers
45
views
Unable to Set Cookies from Express.js to Next.js SSR Component (app router)
I have an Express.js backend running on http://localhost:8000 and a Next.js frontend (App Router) running on http://localhost:3000.
What Works:
• When making a request from a Next.js client ...
0
votes
1
answer
108
views
Cookie issues with Passport: why are cookies not sent/stored?
I'm struggling while implementing authentication in my Express application using Passport.js.
First of all here are all my packages' versions and my config:
"passport": "^0.7.0",
&...
-2
votes
1
answer
80
views
Vite React Proxy Requests to Backend in Production
As I implement passport's Google OAuth2.0 strategy, I realized I need the callback to hit the server, then from there, I can redirect to a different page depending on if the user needs to finish ...
-1
votes
1
answer
55
views
Frontend is not receiving cookies from backend
Stack:
backend(NestJS, Redis, Postgres),
frontend(NextJS)
I got backend running on vps server with nginx configured on domain https://backend.exampleurl.com and frontend running on same domain https://...
0
votes
1
answer
243
views
Issues converting existing express app to use serverless framework
I am currently working on an express app (API) which I now want to convert to use the serverless framework so I can deploy on AWS Lambda. I have done this before and did not have too many issues.
I ...
1
vote
1
answer
249
views
Weak vs strong ETag header
I have express.js based server and working on implementing etag HTTP header. So, I find out express has already etag and 304 status code implementation enabled. I was going through the code as found ...
0
votes
1
answer
67
views
Unbounded breakpoint, some of your breakpoints could not be set using tsx and express
Having a really hard time setting up a breakpoint for debugger in VSCode to a very simple express project which uses tsx. I have 3 files inside my src directory
src/app.ts
import express, { ...
1
vote
2
answers
72
views
Redirect User to Booking Page After Login in React Router v6
Description:
I’m building a room booking system in React with React Router v6. When a user clicks on a booking link (/book/:roomId), if they are not authenticated, they should be redirected to the ...
1
vote
3
answers
2k
views
Why are my global declarations in index.d.ts not being recognized in my TypeScript project?
I'm working with a TypeScript project where I have two files:
index.ts - This file contains the main application logic.
index.d.ts - This file is where I declare global types.
In my index.d.ts, I'm ...
0
votes
1
answer
62
views
Typescript type declaration .d.ts not working with nodemon(ts-node)
I want to add userName property to Request object in express using type declaration file .d.ts to be able to set it through middleware and use in other routes.
here is my /src/types/index.d.ts
export ...
1
vote
0
answers
286
views
PayPal API Error: "The requested action could not be performed, semantically incorrect, or failed business validation"
am integrating PayPal's REST API for processing payments in my React.js application, using the sandbox environment. While creating an order works fine, capturing the payment fails with the following ...
-1
votes
1
answer
104
views
How to locate where UnhandledPromiseRejection is coming from? Already tried a few things
I'm currently building a node.js server application and getting this error message in the server console:
$ tsc && webpack && DEBUG=express:* node --trace-warnings --unhandled-...
2
votes
1
answer
1k
views
Zod Schema Validation of FormData with multiple Files failing
I'm trying to use Zod to perform Schema Validation on a FormData Object which has multiple files (HTML file input element with multi-select) in an Express App. When the Schema is validated, it appears ...