470,271 questions
Advice
0
votes
3
replies
57
views
What is DTO mappers and how to implement DTO mappers?
I'm developing the a website using repository architecture and recently i learned about DTOs and a developer suggested me to use DTO mappers and i found that its something related to transform data ...
Best practices
0
votes
2
replies
53
views
Implementing the Repository Pattern with complex Sequelize associations
I am working on a university project using Node.js, TypeScript, and Sequelize. I've implemented a Repository layer to decouple my database logic from the Service layer.
Initially, my repository was ...
-4
votes
1
answer
49
views
What is the purpose of using DTO Mappers? [closed]
I'm building a MERN stack project using the repository pattern architecture. I understand what a DTO is, and I'm already using several DTOs in my project.
During a code review, a developer suggested ...
0
votes
1
answer
36
views
Drawing to a canvas Path2D in node.js doesn't render anything
I'm working on code to render FontAwesome SVG paths to a canvas and save the result to a PNG locally in node.js. In the process I create a Path2D object and fill it, but nothing draws. To attempt to ...
0
votes
0
answers
62
views
SSL handshake error for Node.js on GitLab CI pipeline
I am trying to set up a CI pipeline in GitLab, for a Spring Boot project with Maven, which also installs npm.
I have tried using docker exec locally to check if doing mvn install would work, and it is ...
0
votes
0
answers
39
views
Better Auth API Key Plugin Types
I am trying to use the apiKey plugin with Better Auth with nestjs. The problem I am facing is that the auth object does not exposes any apiKey related methods. Adding the apiKey plugin breaks the ...
-3
votes
0
answers
36
views
TypeScript error: Property 'accessRequest' does not exist on type' 'PrismaClient<PrismaClientOptions>' even though model exists [closed]
I'm working on a Next.js 14 project with Prisma and getting a TypeScript error when trying to use my accessRequest model
import { NextResponse } from "next/server";
import { prisma } from &...
Best practices
0
votes
2
replies
67
views
What are best practices for unit testing with Jest in JavaScript?
I'm learning Jest and want to make sure I'm building good habits from the start. I've read the official docs but they don't really cover what's considered good practice in real projects. Specifically ...
-3
votes
0
answers
21
views
pnpm + Sanity CLI ERR_REQUIRE_ESM error (fixed by updating Node.js) [closed]
While installing Sanity using pnpm, I encountered the following error:
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
This seems to be related to an ESM compatibility issue between ...
0
votes
1
answer
35
views
Why does my Node.js production deployment return 502 Bad Gateway behind Nginx after restart?
I'm deploying a Node.js web application on a Linux server using Nginx as a reverse proxy. The application works correctly when I start it manually, but after restarting the server or redeploying the ...
-2
votes
1
answer
61
views
How to fix 'querySrv ECONNREFUSED' error when connecting to MongoDB Atlas from Node.js application?
i was trying to run the project and was getting the below error also tried restricting it to ipv4 like this
Error name: Error
Error code: ECONNREFUSED
Error message: querySrv ECONNREFUSED _mongodb....
0
votes
1
answer
40
views
Payment status shows ‘Incomplete’ after adding card during 14-day free trial
const session = await stripe().checkout.sessions.create({
mode: "subscription",
payment_method_collection: "if_required",
subscription_data: {
trial_period_days: 14,
}...
0
votes
1
answer
48
views
Megajs 0.17.2 root property broken
Im using megaJS 0.17.2 in my nodeJS program, but it seems like the root object is not being added to the storage (megaDB) object as a property, as seen in the following code clip of my initMega() ...
-5
votes
0
answers
69
views
create-react-app auto refresh page on code change in production [duplicate]
I have an issue where when I restart and update my production server, users need to refresh the page manually in order to make use of the code changes. This means users who do not know to do this are ...
Advice
0
votes
2
replies
67
views
How to implement barcode scanning in a JavaScript inventory management system?
I’m building a web-based inventory audit management application and want to enable barcode scanning to speed up stock counting. Most scanners act like keyboard input devices, but I want to capture the ...