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

Inline imports aren't parsed correctly #1644

Open
Stilic opened this issue Apr 17, 2023 · 6 comments
Open

Inline imports aren't parsed correctly #1644

Stilic opened this issue Apr 17, 2023 · 6 comments

Comments

@Stilic
Copy link

Stilic commented Apr 17, 2023

Hello!

I'm currently trying to implement ts-json-schema-generator on a TypeScript project.
I came accros an issue where inline imports can't be parsed like normal imports (they are considered as unknown nodes).

I attached a log in case you want to see how the error looks like:
npm.txt

@domoritz
Copy link
Member

Thanks for the report. Can you provide a minimal reproducible example that demonstrates the issue?

@Stilic Stilic changed the title Imports aren't parsed Inline imports aren't parsed correctly Apr 17, 2023
@Stilic
Copy link
Author

Stilic commented Apr 17, 2023

Thanks for the report. Can you provide a minimal reproducible example that demonstrates the issue?

I just made a repo that demonstrate the issue:
https://github.com/Stilic/tjsg-import-example
(use npm run generate to generate the schema).

@domoritz
Copy link
Member

I see. Can you replace import("./Banana") with a traditional import?

@Stilic
Copy link
Author

Stilic commented Apr 17, 2023

I can, yes.

@domoritz
Copy link
Member

Thanks for the issue and I'm glad there is a workaround

@Stilic
Copy link
Author

Stilic commented Apr 17, 2023

Thanks for the issue and I'm glad there is a workaround

It works correctly with classic imports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants