egoist / tsup

The simplest and fastest way to bundle your TypeScript libraries.
https://tsup.egoist.dev
MIT License
9.21k stars 219 forks source link

[bug] error occured in`dts` build #955

Open Tzyito opened 1 year ago

Tzyito commented 1 year ago

describe

When the tsup config ts is declared as follows,I don't know if it's due to my configuration

import { defineConfig } from "tsup";

export default defineConfig([
  {
    entry: ["src/*.ts"],
    clean: true,
    outDir: "dist",
    target: "esnext",
    format: ["cjs", "esm"],
    dts: true,
    shims: true,
  },
  {
    entry: ["src/api/*"],   // this will makes same error,occasionally
    clean: true,
    dts: true,
    target: "esnext",
    outDir: "dist/api",
    format: ["cjs", "esm"],
    platform: "browser",
    shims: true,
  },
]);

this is production directory:

image

When I build using tsup, sometimes I get errors like this

image

unfortunately, I can't provide a use case as this is happening occasionally. but it did happen

Upvote & Fund

Fund with Polar

shortcuts commented 2 months ago

Hey, I encountered that issue after trying to factorize my monorepo tsup config, turns out it was due to wrongly resolved tsconfigs (see this commit for the fix)