egoist / egoist/tsup

TypeError: ts2.isNamedTupleMember is not a function

Open
#808 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11.3k
Forks
275
PR merge metrics
No merged PRs in 30d

Description

dts throws TypeError when typescript is not installed

the error message could be more friendly

```
npx tsup src/index.ts --format cjs,esm --dts

CLI Building entry: src/index.ts
CLI Using tsconfig: tsconfig.json
CLI tsup v6.5.0
CLI Target: esnext
CJS Build start
ESM Build start
ESM dist/index.js 84.52 KB
ESM ⚡️ Build success in 637ms
CJS dist/index.cjs 85.36 KB
CJS ⚡️ Build success in 640ms
DTS Build start
TypeError: ts2.isNamedTupleMember is not a function
at DeclarationScope.convertTypeNode (node_modules/.pnpm/tsup@6.5.0/node_modules/tsup/dist/rollup.js:6738:17)
at DeclarationScope.convertMembers (node_modules/.pnpm/tsup@6.5.0/node_modules/tsup/dist/rollup.js:6692:18)
at Transformer.convertClassOrInterfaceDeclaration (node_modules/.pnpm/tsup@6.5.0/node_modules/tsup/dist/rollup.js:7001:15)
at Transformer.convertStatement (node_modules/.pnpm/tsup@6.5.0/node_modules/tsup/dist/rollup.js:6942:23)
at new Transformer (node_modules/.pnpm/tsup@6.5.0/node_modules/tsup/dist/rollup.js:6899:16)
at convert (node_modules/.pnpm/tsup@6.5.0/node_modules/tsup/dist/rollup.js:6890:27)
at Object.transform (node_modules/.pnpm/tsup@6.5.0/node_modules/tsup/dist/rollup.js:7165:29)
at transformFile (node_modules/.pnpm/tsup@6.5.0/node_modules/tsup/dist/rollup.js:7255:46)
at Object.writeFile (node_modules/.pnpm/tsup@6.5.0/node_modules/tsup/dist/rollup.js:7278:27)
at Object.writeFile (node_modules/.pnpm/typescript@3.9.10/node_modules/typescript/lib/typescript.js:16631:14)
Error: error occured in dts build
at Worker. (node_modules/.pnpm/tsup@6.5.0/node_modules/tsup/dist/index.js:2226:26)
at Worker.emit (node:events:513:28)
at MessagePort. (node:internal/worker:238:53)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:734:20)
at exports.emitMessage (node:internal/per_context/messageport:23:28)
DTS Build error

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.