The `build` API seems to not work in `vitest`
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 275
- PR merge metrics
- No merged PRs in 30d
Description
I can only temporarily use `execa` to call it through the command line.
```sh
❯ npx vitest run tsup
RUN v0.34.1
node:internal/event_target:1016
process.nextTick(() => { throw err; });
^
Error: Unexpected message on Worker: {
type: 'log',
text: '\x1B[34mCLI\x1B[39m Using tsconfig: tsconfig.json'
}
Emitted 'error' event on Tinypool instance at:
at EventEmitterReferencingAsyncResource.runInAsyncScope (node:async_hooks:203:9)
```
```ts
import { build } from 'tsup';
import { it } from 'vitest';
it('tsup build', async () => {
await build({
entry: ['src/index.ts'],
});
});
```
Contributor guide
Research direction
Start with the reproduced Vitest test that imports build from tsup and uses src/index.ts as its entry point. Run the shown npx vitest command and trace how the build API behaves under Vitest. Done means the build completes without the Unexpected message on Worker error, without requiring execa.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100