470,865 questions
0
votes
1
answer
53
views
Does fs.watch in Node.js listen to changes in hidden folders like .git?
If I watch a directory that has a .git inside of it and run fs.watch, does that listen to changes within .git folder?
For example if I use:
fs.watch(dir, { recursive: true }
Tooling
0
votes
1
replies
55
views
Dealing with third party rate limits
I have been working on AWS Serverless Lambdas and now having issues with third party rate limits.
Context
A Lambda invocation triggered by an event:
calls a third-party API 4 times,
runs some logic,...
Advice
0
votes
1
replies
65
views
Why does my OpenAI API (ChatGPT) return 429 ‘rate limit exceeded’ even for low traffic?
I’m integrating OpenAI’s GPT API using Node.js. My app runs fine for a while, but then randomly throws:
Error: 429 - You exceeded your current quota, please check your plan and billing details.
Even ...
0
votes
0
answers
56
views
Electron Builder: Built app starts UI but server + SQLite database do not run in packaged versio
I have an Electron application that uses:
React for the frontend
Node + Express backend inside /Server
A SQLite database stored inside the same /Server folder
During development, everything works ...
1
vote
0
answers
54
views
Generating a virtual image for an Electron application
I’m trying to replace a the content of an image URL with the result of a custom protocol. The idea is to get the data from a zip file.
The img element looks something like this:
<img src="...
0
votes
0
answers
45
views
I'm getting a timeout when adding second page.evaluate with puppeteer
I have this with node 25.0.0 and Windows and puppeteer. Basically the get_card_search_results is called and it loads a page that features lazy loading. It will "scroll" the page down to ...
0
votes
1
answer
655
views
Nextjs TypeError: localStorage.getItem is not a function node version issue
I worked on my other system it works but when i installed the latest npm==10.9.3 and node==25.1.0, and next==15.3.3 it will pop out the following error and cannot render any web page.
⨯ [TypeError: ...
0
votes
0
answers
57
views
Error: read ECONNRESET with Puppeteer and node 25.0.0 on windows
As the title says, I just installed node 25.0.0 and puppeteer on windows. Here is my file:
const puppeteer = require('puppeteer');
var browser;
var puppeteer_options = {
headless: true,
...
1
vote
0
answers
49
views
How to properly log HTTPS (especially SSE) request responses in Electron webview without using deprecated APIs?
Here's a minimal GitHub Gist that runs on Electron Fiddle :
It's supposed to show GitHub Copilot (github.com/copilot) in a webview element as if it was in a normal browser :
Using the following code ...
1
vote
1
answer
84
views
How to call JS code from C++ thread in embedded Node.js/v8 environment
I have Node.js (v22 - I am bound to this version) embedded into my application and exposing a C++ object to its environment.
My JS environment setup (based on the docs) runs in a separate thread, like ...
-3
votes
0
answers
73
views
Role and permission management for RBAC Express.js +TypeScript project
I need to implement role-based access control on the backend with postgresql, Prisma, and Express.js+TypeScript and the roles I have in mind so far are admin, manager, customer, delivery crew. I want ...
0
votes
1
answer
67
views
Property 'VECTOR' does not exist on 'DataTypes' in Sequelize with pgvector
I am building a RAG application using Node.js, Sequelize, and PostgreSQL with the pgvector extension. I have successfully enabled the vector extension in my database.
I am now trying to create a ...
0
votes
0
answers
36
views
How to avoid JWT Refresh Token Race Condition
In my MERN app, when an API call fails with a 401, I intercept it, call the /refresh endpoint to get a new access token, and retry the original request.
The problem: if multiple API calls fail at the ...
1
vote
0
answers
56
views
TypeORM @CreateDateColumn() returns wrong time compared to PostgreSQL
I’m using TypeORM with PostgreSQL. My entity has:
@Entity()
export class AuditLog extends BaseEntity {
@PrimaryGeneratedColumn()
id: number;
@CreateDateColumn()
date_action: Date;
}
When I ...
0
votes
0
answers
46
views
Application running in Docker containers the application restarted using Amazon RDS Aurora MySQL for the database and experiencing out-of-memory issue
UncaughtException: Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap ...
0
votes
0
answers
64
views
Why drag and drop from my application is not happening to any external applications in electron
My problem:
I want to drag a file from my application into the another application like Paint , Windows Excel , Windows Files system ect, but the drop is not happening.
I have an Electron app. The ...
0
votes
0
answers
52
views
Fixing "Incorrect reference digest value" in SOAP XML WS-Security with node-soap
Fixing "Incorrect reference digest value" in SOAP XML WS-Security with node-soap
Problem
I'm experiencing an intermittent issue with SOAP XML requests to an external service using the node-...
0
votes
2
answers
42
views
Next.js multilingual routing. Main page site.com always redirect to site.com/en instead of staying on site.com
devs!
I'm trying to build a multilingual website based on Next.js(15.6) Node 22.21.10. Locally I have no issue with routing everything works as expected. Both lang versions are served as expected. (...
0
votes
0
answers
104
views
Detecting incoming messages vs. status updates using whatsapp-web.js
I'm using whatsapp-web.js for automating responses on my WhatsApp business profile. But there's a recurring issue where the bot mistakenly interprets my contact's status updates (posted publicly to ...
1
vote
0
answers
92
views
Docker build fails on VPS with chown -R appuser:appuser on Node+Python image but works on Local
I'm building a Docker image based on node:20-slim with a Python virtual environment. My Dockerfile includes:
# Use official Node.js image (stable, small)
FROM node:20-slim
# Prevent interactive ...
1
vote
2
answers
110
views
Sequelize transaction stays open too long during API calls, causing connection pool exhaustion
I'm facing an issue with Sequelize(postgres) transactions in a high-traffic Node.js/Express app. I have a flow like this:
async function createPayment(data, trnx) {
// Save in DB within transaction
...
Best practices
1
vote
1
replies
147
views
typescript - 'Response' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled
TypeScript offers type-only imports to explicitly indicate that an import statement is solely for type information and should be completely erased during compilation to JavaScript. This is ...
Best practices
4
votes
4
replies
128
views
Which is a more viable option for a Node.js backend — TypeScript or JavaScript?
I’m setting up a new Node.js backend project and trying to decide whether to go with TypeScript (TS) or stick with JavaScript (JS).
I’m aware that TypeScript offers type safety and better tooling, ...
-2
votes
1
answer
81
views
Fetching all the issues of a project using Jira APIs
I need to fetch all the issues present in the project using the Jira APIs with some specific fields. Is there a way to do so without hitting the rate limit? It should be Hierarchical up to level 3 [...
0
votes
0
answers
55
views
Error when wrapping import function in nodejs
I have the following code:
src/main.js
const importModule = async (moduleName) => {
const mod = await import(moduleName);
return mod;
};
const fs1 = await import("fs");
const fs2 = ...
-1
votes
0
answers
26
views
TypeError: (0 , import_crypto.randomFillSync) is not a function from compiled package
I have a monorepo built with turborepo and I published my private package and in vs code there is no errors but when I install that package in an external app and use a component from within it, I ...
1
vote
0
answers
46
views
Pixelit JS Library - Incorrect Size
I have already submitted a question regarding Pixelit, see this question for background info.
Long story short, I'm making a Discord bot as a learning project and I am just trying to use Pixelit, an ...
0
votes
1
answer
55
views
Why window.close() from renderer process doesn't trigger the close event in Electron's main process?
I'm building an Electron application and trying to close a window from the renderer process using window.close(). However, the close event listener I've registered in the main process isn't being ...
3
votes
1
answer
104
views
Getting SQLite Syntax Error when saving model in Sequelize.js v7
So, I'm trying to learn full stack by making a list app, and I'm using
Sequelize.js for the database. So far I've got User and List models. I
recently switched to Sequelize v7.0.0-alpha.47. I can't ...
1
vote
2
answers
118
views
How to declare type for app.locals.something?
It's the same question as How do I extend the typings of Express.Application to give typings for app.locals but the suggested solution doesn't work for me.
I have server.ts :
const express = require('...
-1
votes
0
answers
24
views
Occasional “NoSuchKey” from S3 right after successful PUT using pre-signed URL (same region)
I’m facing an intermittent issue when uploading files to Amazon S3 from an Android app using a pre-signed PUT URL.
Setup:
Android app uploads directly to S3 via a pre-signed PUT URL.
After receiving ...
1
vote
0
answers
88
views
When I try to run npm I get a crypto binding error
Whenever I try to use npm I get an error:
npm ERR! Error: crypto binding not found.
npm ERR! Please build node with openssl
I have completely uninstalled Node.js and npm, deleted their directories ...
-1
votes
0
answers
150
views
npm creates different package-lock.json on different systems (peer dependencies)
When using npm to install dependencies, my system produces a strange behaviour concerning peer dependencies.
A package referenced in the app (let's call it xyz) has a peer dependency to Vite and ...
0
votes
0
answers
83
views
Decompress .zstd file using typescript
I'm trying to programmatically decompress a .zst file using typescript. This is the code I am using:
import { createReadStream, createWriteStream } from 'node:fs';
import { createZstdDecompress } from ...
1
vote
0
answers
41
views
Why am I getting a decode error when calling a function in my Hardhat smart contract?
I’m building a simple Voting DApp using Solidity and Hardhat.
The contract deploys successfully, and I can start and end voting without issues.
However, when I try to call the getWinner() function ...
3
votes
1
answer
58
views
Query not printed as expected
exports.getAllProducts = async (req, res) => {
try {
console.log(req.query);
const queryObj = { ...req.query };
const excludedFilters = ["page", "limit", "...
3
votes
1
answer
88
views
How do I use Discord.js and Node.js to send an image?
Preface: I truly don't have a clue about anything related to node.js, this is a learning project for me. I do know some Javascript.
I followed this youtube tutorial to begin a node.js and discord.js ...
1
vote
1
answer
93
views
PostgreSQL UUID query issue
I have the following in a TS script that I'm running with the npm tsx package (slicing to 1 item to make it shorter, but same error when using full array):
console.log(psql(`SELECT c.id lead_uuid, ...
-1
votes
0
answers
59
views
Mocking native node: libraries in CJS and TypeScript
I am trying to mock some native node: libraries with Node's native node:test mocking on a CJS TypeScript project. Sometimes I have success when mocking without the node: prefix, other times not.
...
0
votes
1
answer
67
views
Can't register DMX driver [closed]
I'm trying to set up a DMX driver using the 'dmx' library but I get this error when I run my code.
TypeError: this.drivers[driver] is not a constructor
Here is my code:
const DMX = require('dmx');
...
0
votes
1
answer
57
views
Custom error objects for Mongoose schema paths
Take the following Mongoose schema.
const userSchema = mongoose.Schema({
username: {
type: String,
required: true,
unique: true,
minLength: 3
},
name: ...
Tooling
1
vote
0
replies
45
views
Reuse "node_modules" from pre-built dev container
I'm trying to build a pre-built dev container (see here).
Among others, the app uses some Node.js packages. To speed up the dev container performance, I'd like to cache them. For this, I'm running npm ...
-3
votes
0
answers
37
views
When using docker node:alpine build node_modules installs in /usr/local/lib
Why was /usr/local/lib the defaut local packages destination directory in NodeJS docker image ?
FROM node:24-alpine
WORKDIR app/
COPY package.json yarn.lock ./
RUN corepack enable \
&& ...
2
votes
1
answer
92
views
System cache constantly grows when stress testing backend app
I've been stress testing my .NET application that uses PostgreSQL to find memory leaks. The app is very stable memory-wise — memory usage only depends on the number of concurrent connections.
However, ...
0
votes
0
answers
43
views
Failed to deploy puppeteer chromium in Render
I used puppeteer in my Node.js project and wanted to deploy it to Render as Docker image but the puppeteer chromium browser fails to launch in Render and gives me the error trace below. The app runs ...
0
votes
0
answers
52
views
Next.js 15 Middleware: "Cannot find the middleware module" error with NextAuth.js
I'm implementing authentication middleware with NextAuth.js in Next.js 15.3.2 using the App Router. The middleware compiles successfully but throws a runtime error when trying to access protected ...
1
vote
0
answers
35
views
Package not found error in Saucectl command line execution
I am trying to set up Saucectl in my project and I have done the entire setup which includes saucectl config files and env variables.
I verified all the sauce documented Packages option, Dependency ...
2
votes
1
answer
83
views
Browser stops requesting images from Node Server
I’m running a simple test server to test out a few concepts. For testing purposes, I have a directory with a structure like this:
data/
index.html
images/
image1.png
image2.png
...
2
votes
0
answers
87
views
Every day, the first and only the first backend call of my Node/Express app in production fails with ERR_CONNECTION_RESET or ERR_CONNECTION_REFUSED?
I have a basic MERN app in production with a login system that always runs into either an ERR_CONNECTION_RESET or an ERR_CONNECTION_REFUSED AxiosError when first attempting to login after what it ...
6
votes
5
answers
5k
views
Error: "PrismaConfigEnvError: Missing required environment variable: DATABASE_URL"
I’m working on a Next.js + TypeScript project with a MySQL database using Prisma.
I set up my configuration in prisma.config.ts like this:
import { defineConfig, env } from "prisma/config";
...