520 questions
-4
votes
1
answer
45
views
express server ts compiller errors: library diff and declare global namespaces
When I work in development mode via nodemon, there are no problems. After that, I started preparing the code for production. At first, the "tsc" command worked without errors, and then I ...
Advice
0
votes
9
replies
91
views
How to compare a custome Type to an object obtained from Request.body? - Typescript
I'm trying to verify if a parameter of the req.body respects the Type contraints that I set on the custom type
How can I, for example, compare that the content of req.body.conditioncorresponds with ...
0
votes
0
answers
198
views
Failed to parse the TypeScript config file with Jest 30.x and Node 22.18+
I'm running into some inconsistent behavior with Jest 30.x, specifically when parsing a jest.config.ts file that imports another TypeScript module, on Node.js 22.18+. My code uses ESM syntax for the ...
1
vote
1
answer
179
views
Evaluating typed expressions in interactive ts-node
I'd like to know how to evaluate a TypeScript typed expression using ts-node --interactive as a REPL. I'm using a Mac and have installed node v24.5.0 via brew, and I've installed ts-node v10.9.2 and ...
1
vote
1
answer
132
views
ts-node + type: "module" : Can't find .js files?
I'm trying to have ts-node serve my files while developing and tsc compile them when having "type": "module" in my package.json file.
server.ts:
import { sayHello } from "./...
0
votes
0
answers
512
views
`import.meta.dirname` and `import.meta.filename` are `undefined` when using `ts-jest`
I'm trying to move a TypeScript project from CJS to ESM and, along with that, our tests. They're using ts-jest to run, and used to use __dirname and __filename, but in line with the change to ESM, I'...
2
votes
1
answer
220
views
Cannot Find Module Error When Running ts-node with Relative Path
I have tried several different things to try to fix this issue but no matter what I do when running npx ts-node updateCostCenters.ts I continuely get this error
Error: Cannot find module '@/../prisma/...
2
votes
0
answers
83
views
Cannot get node to execute TypeScript that runs in WebStorm outside of WebStorm
I am running WebStorm 2024.4.3.5 and created a Node.js project, using Fastify, React, and TypeScript. I can run my server.ts file using the Edit Configuration Node.js menu item. The "Typescript ...
0
votes
1
answer
45
views
How to use ts-node with child-process.spawn() in Node
Working with Node.js 23.8 and want to run ts-node as a child process. I'm using ts-node to run cli.ts from the lv_img_conv library. I've installed both the lv_img_conv and ts-node libraries globally. ...
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
1
answer
189
views
WebStorm debugger doesn't stop at breakpoints
I'm using WebStorm on a project running TypeScript with ts-node. Normally, I'd set up my debugger by going to package.json and clicking on the "play" button to the left of the start script ...
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
1
answer
2k
views
How to run TypeScript, via ts-node, without ‘experimental’ warnings, and without file extensions on imports
I have a TypeScript project, based on Node.js, with several modules (using workspaces). Everything executes correctly, but I’m still receiving warnings. In particular, when running this (as a package....
-1
votes
1
answer
1k
views
TypeError: Unknown file extension ".ts"
When I'm trying to write normal code with TS just like we do with JS. Then everytime while running the code with ts-node im facing an issue, and I don't how to solve this.
$ ts-node index.ts
...
0
votes
1
answer
276
views
How to set up ts-jest for node?
I am trying to setup testing with ts-jest for a node project but can't seem to get it working after following several guides out there.
Would really appreciate some help here, been at it for hours.
I ...