openapi-typescript
openapi-typescript copied to clipboard
Types aren't correctly exported for CJS
Description
Typescript with "moduleResolution": "node16" will generate an error when trying to import the module from a cjs file.
Could not find a declaration file for module 'openapi-typescript'. '/node_modules/openapi-typescript/dist/index.cjs' implicitly has an 'any' type.
Try `npm i --save-dev @types/openapi-typescript` if it exists or add a new declaration (.d.ts) file containing `declare module 'openapi-typescript';`ts(7016)
| Name | Version |
|---|---|
openapi-typescript |
7.4.4 |
| Node.js | 22.9.0 |
Reproduction
Check here : https://arethetypeswrong.github.io/?p=openapi-typescript%407.4.4
Checklist
- [x] My OpenAPI schema passes the Redocly validator (
npx @redocly/cli@latest lint) - [x] I’m willing to open a PR (see CONTRIBUTING.md)