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

202
Views
Parcel does not generate type declarations for a TypeScript library

I just started using Parcel and I have this issue, where it is not generating type declarations and emits an empty index.d.ts file instead. Here is my configuration in package.json:

{
  // ...
  "scripts": {
    "prepare": "yarn build",
    "check": "tsc --noEmit",
    "watch": "parcel watch --no-source-maps --no-cache",
    "build": "parcel build --no-source-maps --no-cache"
  },
  "main": "./lib/index.js",
  "source": "./src/index.ts",
  "types": "./lib/index.d.ts",
  "module": "./lib/esm/index.js",
  "devDependencies": {
    "@parcel/packager-ts": "^2.0.1",
    "@parcel/transformer-typescript-types": "^2.0.1",
    "@types/node": "^16.11.9",
    "parcel": "^2.0.1",
    "typescript": "^4.5.2"
  },
  // ...
}

And here is a simple example of an type that I have defined in my code:

export type Response = {
  /**
   * The list of added/removed hashes
   */
  hashes: string[];
  /**
   * The list of skipped hashes
   */
  skipped: string[];
};

Any ideas why this is happening? Have I configured something incorrectly? I have followed this documentation.

Thank you.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It looks like your issue is caused by the the "incremental": true line in your tsconfig.json's "compilerOptions" (see here). If you remove this line, parcel should generate .d.ts files as expected.

(In an ideal world, parcel should be able to handle this case - I filed this bug with parcel to report the problem - and this PR to fix it).

about 4 years ago · Juan Pablo Isaza Report
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!