Closed aayush123 closed 3 weeks ago
@hyeonss0417 What do you think would be the appropriate fix for this? I'd be happy to submit a PR, just need a small nudge
Hello, @aayush123
Thank you very much for taking the time to report the bug and for your interest in our project.
I tested it on the test repo you reported, and when I modified the dist/index.d.ts
file like below, the openapi.json
file seems to be generated as expected when I build it.
export * from './generator';
export * from './server';
export * from './types/tspec.d.ts';
The cause of the problem is that in tsconfig, "module": "NodeNext"
in tsconfig, I think it's caused by Directory modules (index file resolution) not working properly.
I'm trying to find a solution to the problem, but I don't know the exact solution yet🤔.
Hi @aayush123
Thank you so much for your interest in contributing to the project and for reporting the issue. I appreciate your willingness to work on a fix.
Upon further investigation, I realized that the bug was more complex than it initially appeared. To ensure it was resolved correctly and promptly, I went ahead and made the necessary changes myself. I’ve just submitted a PR with the fix.
However, I encourage you to take a look at the PR (#61) to see how the issue was resolved. Your feedback and any suggestions for improvements are always welcome. Additionally, there are many other areas in the project where your contributions would be invaluable, and I’d be happy to guide you through any of them.
Thank you again for your support and understanding.
Best regards
I just have merged the PR (#61), and the issue is fixed!
To resolve this issue on your end, please update tspec version to latest(=v0.1.115).
Once again, thank you for your valuable feedback. Your contributions help us improve the project significantly.
Describe the bug Our application uses
"module": "NodeNext"
in the tsconfig file, however, when importing Tspec as mentioned in the docs, it gives the following error: Module tspec has not exported member Tspec:It seems that the imports show up when using
"module": "commonjs"
(didn't try other options) Unfortunately, we are not able to switch to commonjs and must continue using NodeNextTo Reproduce
npm i
npm run build
(This runsnpx tspec generate --outputPath openapi.json
)openapi.json
contains an empty schema. Also notice the import error in index.ts (in VSCode)"module": "NodeNext"
to"module": "CommonJS"
intsconfig.json
npm run build
again.Expected behavior We should be able to import Tspec even when
module
in tsconfig is set toNodeNext
Additional context I'd be happy to create a PR to fix this with minimal guidance.