1,315 questions
0
votes
1
answer
23
views
Nuxt4 & Cannot find name 'defineEventHandler' at server folder
"nuxt": "^4.2.0",
server/middleware/auth.ts & server/api/auth.ts can not find defineEventHandler
export default defineEventHandler(async (event) => {
});
-1
votes
0
answers
16
views
Cannot find name 'defineEventHandler' at server file
enter image description here
"nuxt": "^4.2.0",
Nuxt will automatic import the functions related to H3.So it should be work at server folder.But i noticed that the tsconfig.json is ...
0
votes
0
answers
44
views
VSCode Intellisense doesn't work in Turborepo jit package
everyone. I've been stuck on a minor issue for a few days, but I haven't been able to find the answer, so I'm reaching out for your help.
I am developing a personal project using Turborepo. The ...
0
votes
1
answer
89
views
How to import 'lightweight-charts' with ES module way?
I would like to use lightweight-charts library with ES module.
I would like to use lightweight-charts on browser so I followed instruction of the document
https://tradingview.github.io/lightweight-...
4
votes
0
answers
144
views
Inject migration angular didn't work on nx workspace
I use this nx generate @angular/core:inject to migrate projects but get below error:
Could not find any files to migrate under the path /home/jibit/Desktop/jibit-angular-workspace/. Cannot run the ...
2
votes
0
answers
80
views
VSCode typescript doesn't show error that tsc does
I have a monorepo with typescript project references and npm workspaces and I have a problem with mixed JS/TS code - while VSCode reports "all good" in a TS file, running tsc -b against the ...
0
votes
1
answer
99
views
Typescript ts config: noUnusedLocals & noUnusedParameters exclude folder
I want to use noUnusedLocals and noUnusedParameters for my app, but only in ./src folder.
"noUnusedLocals": true,
"noUnusedParameters": true,
I have a folder structure like so:
├──...
0
votes
1
answer
74
views
How to use TypeScript path on Node.js with tsc-watch?
I'm writing an application and decided to shorten paths using aliases. However, with all my settings I can't get Node.js to see the paths.
This is my tsconfig.json:
{
"compilerOptions": {
...
0
votes
0
answers
41
views
TSConfig settings to catch access before initialization reference errors
I have a function which accesses a variable which is declared below, but for some reason TS doesn't seem to show this as a warning or error (playground example).
// ts actually allows this...
function ...
0
votes
0
answers
83
views
Why does "moduleResolution": "node" resolve my TS7016 errors when looking for a declaration file?
I'm working on a few TS packages with the following setup and am getting TS7016 errors.
Module A (to-be-imported)
// package.json
"name": 'module-a'
...
"main": "./...
1
vote
1
answer
81
views
Sharing types between two TypeScript libraries
Is it possible to only share types between two separate libraries in a monorepo and/or modules? My most common situation is needing to share computed types between a server and client. I can't share ...
0
votes
1
answer
129
views
TypeScript compiler not reporting type errors in monorepository
The objective is to run the type-checking command from the root of the project, which should validate the code across all packages specified in the workspaces. The current setup successfully executes ...
0
votes
1
answer
89
views
types.d.ts is not being automatically included in every TypeScript file
I've noticed that the types.d.ts file in the root of the project was automatically included in every TypeScript file in my project. I didn't have to write import type {...} from "./types.d.ts&...
0
votes
0
answers
61
views
Build errors in node_modules files in Next.js application
When I build my Next.js application (using tsc -b and next build) I get errors in files inside node_modules even though I have skipLibCheck: true and "node_modules" in the "exclude"...
1
vote
0
answers
38
views
Unable to resolve signature of method decorator when called as an expression. Tsoa Error
Unable to resolve signature of method decorator when called as an expression.
The runtime will invoke the decorator with 2 arguments, but the decorator expects 3
@Get('/')
public async getAllUsers(...
0
votes
0
answers
52
views
Defining multiple index files in compilerOptions.paths in tsconfig.base.ts in an Angular NX project
In my Angular NX project I want to separate my app domains in folders with sub-folder for each feature/util/store etc. All exposed APIs are referenced in 'public-api.ts' barrel files in each of those ...
0
votes
0
answers
80
views
Change tsconfig.json used in VS Code
Okay so, I am creating a TypeScript library and I want it to run on Node.js and on the browser. I have a base tsconfig.json file, which sets some default configuration for TypeScript, and tsconfig....
0
votes
0
answers
37
views
tsconfig path alias with barrel files
I would like to have a simple import for our component library, something like this:
import { Button, Hero } from '@ui'
I currently get the error Module '"@ui"' has no exported member '...
0
votes
1
answer
282
views
tailwind.config.ts is not created by default; if create it manually, the styles still don't work
When I create Next.js project. Running:
npx create-next-app@latest
Then I choose all options and TailwindCSS as well. But after installation the tailwind.config.ts file is not created at all.
When I ...
0
votes
0
answers
106
views
How can I suppress the warning Add only entry points to the 'files' or 'include' properties in your tsconfig. that appears during a NX angular build?
When building my NX Angular application I include **/env**.ts in tsconfig.app.json. I do this to compile all env files. However I determine which ones will be used in webpack.config.ts. I add files ...
0
votes
0
answers
20
views
VS Code does not realize a path for an image is incorrect in a TypeScript/Webpack project
I expect VS Code to underline a bad path for an image. If the correct path is import Logo from "./assets/logo.png";, then changing it to import Logo from "./assets/logo1.png"; ...
0
votes
0
answers
106
views
NX Generators - Set module to "ESNext" instead of "commonjs" in tsconfig.json
I want to create an NX generator to ensure that newly generated projects e.g. of type @nx/js:library have their compilerOptions module value set to "ESNext" and not "commonjs" at ...
0
votes
1
answer
25
views
hide "create new content"-button in border-column for specific user-group (f.eg. simple editors) in TYPO3 BE
I'm on TYPO3 12.4 and trying to hide the "create new content" button or the hole column "border" in TYPO3-Backend for a specific user-group (editors).
It sounds like a simple task ...
2
votes
1
answer
559
views
TypeScript tsconfig extend compilerOption paths instead of override
I'm using NX to host a monorepo with my frontend and my backend.
My issue is that I'd like to share my TypeORM entities between my backend and frontend, but on the frontend side, instead of using the ...
1
vote
0
answers
62
views
Typo3 bootstrap_HTML Tag changes my video tag to entity
I just upgraded my TYPO3 installation from 11 to 12 and now I am facing the fact that the HTML element inside my Carousel is changing my video tag to entities when I save my changes. I already looked ...
6
votes
2
answers
13k
views
ESLint Rule to Warn on Typescript's erasableSyntaxOnly flag
Typescript is launching --erasableSyntaxOnly flag in v5.8 that will throw an error if you use things like enum or parameter properties in classes (see article for more details).
When I enable that ...
0
votes
0
answers
159
views
Monorepo tsconfig alias path in packages not work
I use turborepo + vite + react + typescript.
// apps/web/vite.config.ts
import { defineConfig } from 'vite';
import path from 'path';
export default defineConfig({
resolve: {
preserveSymlinks: ...
1
vote
2
answers
393
views
Typescript build error after tsconfig changes?
I am working with NestJs and Typescript 4.7.4. I am having an issue when Architecture team decide to update tsconfig like this
compilerOptions: {
"target": "es2020",
...
}
to
...
1
vote
0
answers
109
views
SVG Sprite not working in the consuming app
I implemented an SVG sprite file generation for all my SVG icons. It works and I have a fully working file within components/icons/sprites/icons.svg. Then inside my Index.tsx file I have:
import { ...
0
votes
0
answers
184
views
Debug Nest.js application with Visual-studio-code in Nx monorepo
Trying to debug Nest.js application using vscode.
Auto Attach: always
Tried to find some relevant configuration, but could not find any, so I tried using the Next.js configuration suggested in this ...
0
votes
1
answer
145
views
check library files in typescript but don't emit them
I'm working on an sub-module for an old school pure PHP project.
This project has a folder for some JS dependencies.
For my sanity, I'm using Typescript in the sub-module but I'm having trouble with ...
3
votes
1
answer
57
views
How to use imports between workspaces
Error TS6202: Project references may not form a circular graph.
My structure:
-packages
--utils
--api
utils/tsconfig.json
...
references: [../api/src]
api/tsconfig.json
...
references: [../utils/src]
...
0
votes
0
answers
47
views
VSCode not highlighting strictNullChecks error in my ts file
Here's my minimum working example:
main.ts:
let a = null;
a = 5;
tsconfig.json:
{
"compilerOptions": {
"target": "es2016",
"module": "commonjs&...
0
votes
1
answer
175
views
I'm trying to compile my ts file in esm, but it is getting compiled as cjs
My setup:
ts.config setup
{
"compilerOptions": {
"target": "es2016",
"module": "NodeNext",
"rootDir": "./src",
&...
2
votes
1
answer
89
views
Is there a typescript compiler option that prevents implicit widening from readonly properties to read/write?
By default, typescript treats readonly object properties as satisfying standard read/write properties during type checking. This happens without type assertions or any other trickery. This is a ...
0
votes
0
answers
237
views
Using tsup to bundle React components and Express routes
I have a monorepo that includes a Next.js application front-end, an Express back-end, and a component library. The component library is bundled with tsup using the following configuration:
import { ...
2
votes
0
answers
84
views
Bundling external types when publishing an NPM package
Two scenarios:
A. A monorepo such as a PNPM workspace with a backend and a client. The backend will never be published as a package, being internal. The client, that will be published, uses types from ...
0
votes
1
answer
27
views
I want to use alias path in codes, but paths property in tsconfig does't work
Here is my tsconfig:
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
"...
0
votes
0
answers
128
views
Output file has not been built from source file - Vite + TS
Issue:
Output file '/home/some_path/vite.config.d.ts' has not been built from source file '/home/some_path/vite.config.ts'.
The file is in the program because:
Matched by include pattern '**/*....
0
votes
0
answers
153
views
How can I import from the root of a package with multiple `rootDirs`?
Let's say I have a monorepo with a package app and a package lib:
root/
package.json
tsconfig.json
packages/
app/
package.json
ts.config.json
App.tsx
lib/
package....
0
votes
1
answer
59
views
NestJS build not properly compiling tsconfig.paths pointing to index.ts
I've got a NestJS app with compilerOptions.paths specified as follows:
"paths": {
"@core/interceptors": [
"core/interceptors/index.ts"
]
}
...
0
votes
1
answer
231
views
How can I use separate `src/` and `test/` files in a Typescript project?
I'd like to keep my source code and tests separate in my Typescript project:
packages/
torgler/
package.json
tsconfig.json
src/
FlidgetTorgler.tsx
WingleTorgler.tsx
test/
...
0
votes
1
answer
357
views
Howto solve the Problem with "ESNext" support in the default Vite/Vue project Template
Update
I found the reason. It's the order of settings in the tsconfig files.
I have created a GIT repository where it can be reproduced.
https://github.com/MBurchard/2024-12-04-vite-test
The problem ...
1
vote
1
answer
101
views
TYPO3 DCE remove “Select & Upload Files” button
I’m using TYPO3 v12 and DCE (Dynamic Content Elements) extension.
I have managed to remove the “Select & Upload Files” button from the standard content elements (Image, Image & Text, Media) ...
0
votes
1
answer
205
views
WebStorm does not detect tsconfig.*.json files when using extends
I'm using yarn workspaces. Each of of my modules contains a tsconfig.json that extends a root level file. WebStorm previously seemed to be able to follow each file but has suddenly stopped doing so. ...
1
vote
1
answer
227
views
does not provide an export named 'isEqual' | Angular
import { isEqual } from 'lodash';
onSave() {
const isFormsEqual = isEqual(
this.loyaltyRewardsFormFacade.currentRewardsState(),
this.loyaltyRewardsFormFacade.transformFormData()
);...
0
votes
1
answer
679
views
How to use ES2022 in Nest.js config
I'm trying to make I Nest.JS project use ES2022 cause I'm trying to use an ES module package. I have updated the tsconfig.json and paackage.json but it doesn't work as it keeps coming up with this ...
0
votes
1
answer
633
views
TypeScript getting error TS2307 cannot find module 'src/' when running tsc
I am trying to configure my tsconfig.json for a package inside my react native project with metro to add module resolution and make the code cleaner so instead of
import { LABELS } from "../../../...
2
votes
2
answers
671
views
Typescript inferring type incorrectly - importing as alias and defaulting to any
I'm building a monorepo using Nextjs for the frontend and bun & hono for the backend. I'm trying to use hono rpc: https://hono.dev/docs/guides/rpc. I'm exporting the type of my router like this in ...
0
votes
1
answer
108
views
Math.sign() not existing on Math despite lib target set to es2016
I'm in the process of migrating my JS codebase to TS. It uses the method Math.sign(). However, the compiler gives this error-
Property 'sign' does not exist on type 'Math'. Do you need to change your ...