-
Notifications
You must be signed in to change notification settings - Fork 103
Open
Description
Describe the bug
When using Vite to build a library with an anonymous abstract class inside a function, the abstract keyword may be lost in the output .d.ts file. This can lead to a situation where it appears that the method is already implemented, even though it should not be. Consider defining the class outside of the function or using a named abstract class to retain the abstract keyword in the generated TypeScript definitions.
Reproduction
https://stackblitz.com/edit/sb1-zwpa78c3?file=vite.config.ts
Steps to reproduce
Run pnpm install and pnpm build.
You're going to be able to see d.ts in the dist folder.
System Info
System:
OS: Linux 5.0 undefined
CPU: (6) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 20.19.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
vite: ^5.4.2 => 5.4.21
vite-plugin-dts: ^4.5.4 => 4.5.4Validations
- Read the FAQ.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels