Cannot build index.d.ts file due to an invalid export syntax
vinibiavatti1 opened this issue · 5 comments
Describe the bug
Since the option esModuleInterop: true
is not set to the project, the file index.d.ts cannot be compiled. This happens because the module definition of the file uses an invalid export syntax, when it should use the export=
syntax type. This is described better on this documentation: Module.d.ts
Note that using export default in your .d.ts files requires [esModuleInterop: true](https://www.typescriptlang.org/tsconfig#esModuleInterop) to work. If you can’t have esModuleInterop: true in your project, such as when you’re submitting a PR to Definitely Typed, you’ll have to use the export= syntax instead
File path: https://github.com/asyncapi/spec-json-schemas/blob/master/index.d.ts
How to Reproduce
npm run build:prod
(tested in local environment only)
Link to GitHub repository with project that has issues:
https://github.com/asyncapi/server-api
Expected behavior
After running the command, it should finish without any build errors.
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
@vinibiavatti1 Hi! Thanks for the issue! Do you wanna create PR with fix?
sure @magicmatatjahu. Let me solve it and I will open a PR
🎉 This issue has been resolved in version 4.0.1 🎉
The release is available on:
Your semantic-release bot 📦🚀