Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build index.d.ts file due to an invalid export syntax #287

Closed
vinibiavatti1 opened this issue Nov 21, 2022 · 5 comments · Fixed by #288
Closed

Cannot build index.d.ts file due to an invalid export syntax #287

vinibiavatti1 opened this issue Nov 21, 2022 · 5 comments · Fixed by #288
Labels
bug Something isn't working released

Comments

@vinibiavatti1
Copy link
Contributor

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.

@vinibiavatti1 vinibiavatti1 added the bug Something isn't working label Nov 21, 2022
@github-actions
Copy link

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.

@magicmatatjahu
Copy link
Member

@vinibiavatti1 Hi! Thanks for the issue! Do you wanna create PR with fix?

@vinibiavatti1
Copy link
Contributor Author

sure @magicmatatjahu. Let me solve it and I will open a PR

@vinibiavatti1
Copy link
Contributor Author

#288

asyncapi-bot pushed a commit that referenced this issue Nov 24, 2022
@asyncapi-bot
Copy link
Contributor

🎉 This issue has been resolved in version 4.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants