Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

213
Vistas
getting Typescript error TS2304 : cannot find name ''customType"

i have a custom type called JWTSubject

and when trying to compile i get this error

error TS2304: Cannot find name 'JWTSubject'

my tsconfig.json looks like so;


{
      "compilerOptions": {
            "target": "es2016" ,
            "module": "commonjs" ,
            "rootDir": "./src" ,
            "typeRoots": [
                  "./@types",
                  "./node_modules/@types"
            ] ,         
            "outDir": "./dist" ,
            "removeComments": true ,
            "esModuleInterop": true ,
            "forceConsistentCasingInFileNames": true ,
            "strict": true,
            "skipLibCheck": true,
      },
      "include": ["./src", "./@types"],
      "exclude": [".git", "node_modules"]
}


my file structure looks like so;

├───src
│  
├───@types├── global.d.ts
│         │
│         └── custom ── index.d.ts              
│
├───tsconfig.json
│ 

global.d.ts looks like ;


import IUser from "../src/interfaces/IUser";

declare global {
      export type JWTSubject = {
            _id: IUser["_id"];
            username: IUser["username"];
      };
}


about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda