Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/prinzhorn/hey-api-openapi-ts-mts


https://github.com/prinzhorn/hey-api-openapi-ts-mts

Last synced: 24 days ago
JSON representation

Awesome Lists containing this project

README

        

# hey-api-openapi-ts-mts

We have a Node.js project that is still CommonJS, but it uses TypeScript (`tsx` locally, `tsc` to build).

Now I need to integrate a client generated by openapi-ts. This is a minimal repo extracted from our code. `index.ts` is a CommonJS module. It includes `worker.ts`. Which is now an ESM module to be able to load the generated client. Locally with `tsx` this works perfectly fine. But the `tsc` build fails.

## Steps

1. `npm run generate-client`
2. `npm run start` -> This successfully runs the code with `tsx`
3. `npm run build` -> This fails to build the code using `tsc`