Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

210
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!