All Questions
Tagged with node.js typescript
16,351 questions
-1
votes
1
answer
19
views
Bad Option: --env-file=./env/.env.dev
I am unable to load the env file via start script in my package.json file because of which I am not able to work on my project, earlier with all these stated settings it used to work fine.
package....
0
votes
1
answer
24
views
All the services return as a undefined in Global Interceptor in NEST JS
I am trying to create a global interceptor in NestJS and call a service inside it. I have followed all the documented steps, but all the services used within the interceptor are still returning as ...
0
votes
0
answers
19
views
Getting gibberish file when trying to download a mp3 file using playwright
So, I am trying to create a scraper for a online playlist and using playwright as I have been trying my hand at this framework but when downloading a mp3 file, no matter whatever I try using different ...
0
votes
1
answer
25
views
How can I "inline" typescript dependencies?
I have a project that depends on 3 external dependencies
I'd like to inline those in my project such that their code is under a single source tree and I can remove them from package.json
Is there a ...
0
votes
1
answer
58
views
Puppeteer executing the first click action in an array immediately, regardless of delay
I'm facing a seriously weird issue with puppeteer, running on Chrome.
I have an array of click actions I want to execute on a webpage, which has a pdf.js based slideshow. Each action consists of ...
-3
votes
0
answers
27
views
Getting error "Cannot find module 'graphql-upload' or its corresponding type declarations." in Node TypeScript application
I have created a Node application which uses TypeScript and below I have defined my tsconfig.json:
{
"compilerOptions": {
"module": "commonjs",
"...
-2
votes
0
answers
33
views
How to Deploy a Node.js (TypeScript + Prisma) REST API on Namecheap Shared Hosting? [closed]
I have a Node.js REST API written in TypeScript, using Prisma ORM with a MySQL database.
For testing, I deployed it to Railway, which worked fine because it pulled from GitHub and managed deployments ...
0
votes
0
answers
19
views
NestJS Prisma Generated Types Not Included in dist folder
I'm working on a NestJS backend and using Prisma for my database. I generated my Prisma type with the following configuration:
generator clientTypes {
provider = "prisma-client-js"
...
0
votes
0
answers
23
views
TypeScript Error: 'authenticate' Property Does Not Exist on FastifyInstance Type When Using JWT
I'm having an issue with my Fastify + TypeScript application. When I try to use the authenticate method in my routes, TypeScript gives me the following error:
Property 'authenticate' does not exist on ...
0
votes
0
answers
34
views
npm run build is failing due to @types.lodash-es incompatability
These are the errors I'm facing in Angular 7:
22:12:30 node_modules/@types/lodash/common/collection.d.ts(753,33): error TS2304: Cannot find name 'PropertyName'.
22:12:30 node_modules/@types/lodash/...
-2
votes
0
answers
32
views
Automatic response header writing in nodeJS [closed]
I'm having a problem with a controller (create), each db call made using mongoose (look at the service) will automatically write to response headers with no manual control over it, that's leading to ...
-3
votes
0
answers
32
views
What's the simplest transpilation setup to assign the same value to module.exports and module.exports.default?
https://andrewbranch.github.io/interop-test/#synthesizing-default-exports-for-cjs-modules describes the following problem:
In Node, a default import of a CommonJS module always links to the module....
-2
votes
1
answer
35
views
Azure Function Node.js Typescript v4: Functions not found after 2nd deployment after
I have an issue that appears others have had in the past which is after deploying an Azure Function Node TypeScript v4 app, the functions are not found.
I have read the following existing Stack ...
2
votes
1
answer
37
views
Why can't I swap with some SPL tokens when I use Jupiter v6 Swap API?
I am gonna buy and sell SPL tokens using Jupiter Quote API and Swap API.
My code works with some tokens but I failed with some tokens.
However, I can see lots of holders for those tokens on Solcan.
I ...
1
vote
1
answer
31
views
Why is this Express Router catchall route overriding a route above it?
I can't figure out why this routing configuration, with eRouter being an express.Router() defined in an index.ts and passed in, is causing the top route of GET /wzdx/DeviceFeed to be overwritten and ...
-1
votes
0
answers
14
views
Length of the verification code sent to a user's email when using Clerk's signUp.prepareEmailAddressVerification()
I want to be able to know the length of the code that will be sent to a user when they sign-up using my Custom UI that is infront of the Clerk's backend API.
await signUp....
0
votes
0
answers
14
views
Nodejs mysql2/promise deleted data problem
I am trying to resolve an issue in my app.
The problem occurs when I delete data from the MySQL server; my Node.js app still displays the deleted data. However, once I edit any TypeScript (.ts) file ...
-2
votes
0
answers
36
views
transfer between accounts connected to stripe [closed]
I have the following scenario: in my system, a user can book services at a company. This booking can consist of multiple services, and each service has a professional assigned. At checkout, the user ...
0
votes
0
answers
23
views
langchain dependencies with TypeScript [closed]
"workspace-aggregator-0f235ec8-b7fe-42cb-a3aa-6931db32d29f > backend > @browserbasehq/[email protected]" has unmet peer dependency "@playwright/test@^1.42.1".
warning "...
1
vote
1
answer
40
views
Next.js + Mongo/Mongoose query taking 3+ minutes in local dev: “DB Query time: 168,000 ms”
When a user logs in on src/app/page.tsx, I redirect them to /student/dashboard, which calls my /api/tasks endpoint (passing ?userId=...&page=1&limit=20) to load the user’s tasks. However, my ...
0
votes
0
answers
56
views
How to trigger certain events manually for streamdeck sdk?
I am developing a plugin for the Streamdeck using the elgato streamdeck SDK.
I work on the example project generated by streamdeck create.
I know I can register an action onWillAppear, that will be ...
2
votes
1
answer
86
views
NextJS (15.1.7): ReferenceError: XMLHttpRequest is not defined
ERROR DESCRIPTION
Hey everyone! There is code snippet of my frontend:
'use client';
import Image from "next/image";
import { doSomething } from "./serveractions/do-something";
...
0
votes
0
answers
28
views
Generate private key for signing SAML requests and certificate for verification of the signature in typescript
I have an application written in typescript which allows SAML SSO into it. So the application functions as a service provider. SAML requests are sent to Auth0 which is used as an identity provider.
My ...
0
votes
0
answers
52
views
How to Print a Ticket in React TypeScript Without Using Window Printer?
I am developing a React TypeScript application where I need to print a ticket directly to a thermal printer without using the browser's print dialog (i.e., without window.print()).
I tried using react-...
0
votes
1
answer
28
views
Jest mock chained calls
Hi I have a follow code:
import { Injectable, NotFoundException } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoose';
import { INote, Note, ...
0
votes
0
answers
25
views
Recreate http post request with nodejs from Watchguard firebox login
I have a Watchguard Firebox T40-W. It has a web login where you can access all kinds of informations.
My goal is to duplicate that same web request with nodejs to be able to get those informations via ...
0
votes
0
answers
32
views
Running express typescript development server throws TypeErrors but not when i build and run it [duplicate]
I have extended the native Express Request object using
// types/express.d.ts
import { User } from '../UserTypes'; // Ensure this is correct
declare global {
namespace Express {
...
0
votes
0
answers
39
views
How to make my script press enter in node js?
in my project I have a typescript class that is used to create a server-proxy. To do this I have to run a command which then in the terminal prompts me to input data such as username etc. I have ...
-1
votes
1
answer
31
views
Showing error invalid url in terminal while connecting database through appwrite
Error TypeError: Invalid URL
at new URL (node:internal/url:796:36)
at Account.create (webpack-internal:///(action-browser)/./node_modules/node-appwrite/dist/services/account.mjs:71:17)
at $...
0
votes
1
answer
55
views
Next.js Middleware Not Detecting JWT Cookie Set by Spring Boot Backend
I am working on a software that includes a Nextjs Front End and Spring boot backend
Please Note: Note:axios is used for the login request
On the front end the application has about 4 urls
which is ...
0
votes
0
answers
31
views
NextJS Server Action cannot read data from exported list
I have a NextJS Project that uses instrumentations.ts to create a websocket server. I am trying to access the connected clients from a server action however, any exported variables are defaulted to ...
0
votes
1
answer
96
views
invalid checksum when using multipart upload with FULL_OBJECT checksum in NodeJS
Problem
I am trying to upload a file into AWS (since I am testing I am using a dockerized minio).
I am calculating the checksum of the file like this:
const fileContent = await readFile(fileName, {
...
5
votes
2
answers
227
views
Share mongoose connection between repositories in a TypeScript monorepo
My MonoRepo structure
Full example and testable code is here:
https://gist.github.com/SohamRoyNoel/c50fac02c0f07d3816e8f31797478013
Intent: I want to bring out database from app1 and app2 level and ...
0
votes
1
answer
56
views
How to debug configuration issue with allure-vitest/reporter
I have simple test automation project with TypeScript + Vitest + allure-vitest reporter. I have tried to upgrade/downgrade main dependencies without any luck.
It works perfectly on one type of machine ...
0
votes
0
answers
50
views
How to calculate the uptime of an AWS EC2 instance from the time it entered the "running" state?
Can somebody guide me in calculating the uptime of an AWS EC2 instance from the time it entered the "running" state, excluding the time spent in "pending" or "starting" ...
0
votes
0
answers
15
views
Nodejs process.cpuUsage numbers don't look right, keep growing
I'm trying to use the process.cpuUsage function and it is not behaving as expected. I pass the last sample in to get the usage delta, but the numbers mostly keep growing. For the example below I ...
0
votes
1
answer
78
views
How can I use native Node modules in my packaged Electron application?
I know this question have been asked quite frequently all over the web, but I can't find any answer that resolved my issue, so I'll try to ask with my own specifications.
I am building a desktop ...
0
votes
1
answer
203
views
Jest mock mockReturnValue not a function
Hi I am trying to mock a function from a module within my node_modules. The current way I have tried is
import { getPriceImpactForPosition } from "@gmx-io/sdk/utils/fees/priceImpact.js";
...
1
vote
0
answers
17
views
Repository triggers first and then decorator
I have nest.js project, where i have decorator which is getting records of images by the id what is provided.
import { AfterLoad } from 'typeorm';
import { AppDataSource } from 'src/config/ormconfig';
...
0
votes
0
answers
15
views
interface for model and general in ts
I am stuck in a situation please help.
I created a interface for User Model in mongoose and ts. the model has profile pic field which consists of a reference to document model. so my user schema model ...
0
votes
0
answers
31
views
Using req.user with JWT make my app crash with express.js and Nodemon
I have a problem since yesterday and I still don't figured it out after many hours passed to try many solutions.
I'm building an app using Typescript with Express.js and I'm using nodemon server to ...
1
vote
1
answer
46
views
Having problem with adding module and service injection
I have user module and auth module in my nest project.
everything is working but, when am trying to inject auth service in to the user service am getting this error:
**Error: Nest can't resolve ...
3
votes
1
answer
76
views
Error in nextjs app: Error: Cannot find module 'next/dist/compiled/ws'
When I try to run npm run dev I get this error:
[Error: Cannot find module 'next/dist/compiled/ws'
Require stack:
/mnt/c/Users/Marcus Flavio/OneDrive - Microsoft 365/Área de Trabalho/Projects/...
-1
votes
1
answer
38
views
Socket IO usage with Strapi Typescript
I am trying to use SocketIO between my react front end and strapi backend.
What i have done is the following:
import { Core } from '@strapi/strapi';
export default {
/**
* An asynchronous ...
1
vote
1
answer
66
views
Error [ERR_MODULE_NOT_FOUND]: Cannot find module when using bundler resolution
I switch to bunder resolution with my project, the project build process works fine, when run this application, shows error:
node:internal/errors:496
│ ErrorCaptureStackTrace(err);
│ ^
│
│ ...
0
votes
1
answer
38
views
How to import a type from a non-main file?
What research have I tried to do? This feels like a very basic question, but trying to research it has yielded a wealth of irrelevant content tangentially related to the keywords, multiple attempts at ...
0
votes
0
answers
52
views
Failing to run the Nuxt Project: Says Consolas does not provide an export named 'consola'
When I run de Nuxt project I receive this error:
ERROR [worker reload] [worker init] /home/mvarela/workspace/zafir/raviish-portal/.nuxt/dev/index.mjs failed ...
2
votes
0
answers
71
views
Jest Encountered Unexpected Token 'export' in Node Module "@kubernetes/client-node" while Running Tests
I am running a Jest(Version:^29.7.0) test suite in a Node.js v22 environment using TypeScript. Used "@kubernetes/client-node" library version: "^1.0.0".
When I try to execute my ...
0
votes
1
answer
79
views
Nestjs build started building inside of SRC instead of ./dist
I was building my Nest.js normally with this command "build:dev": "yarn nest build && cp package.json dist/package.json && cp -R prisma/schema dist/schema && cp ...
0
votes
0
answers
36
views
migration from openapi-generator to openapi-typescript for types generation
I am migrating the code from OpenAPI Generator to OpenAPI TypeScript to generate the types. Currently, I have written the following piece of code that generates the types,
const ast = await ...