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

[BUG] VSCode is not resolving types when opensearch-js is imported via require #839

Closed
dblock opened this issue Aug 13, 2024 · 2 comments
Closed

Comments

@dblock
Copy link
Member

dblock commented Aug 13, 2024

What is the bug?

Coming from #803 (comment). VSCode resolves types when import, but not require.

How can one reproduce the bug?

Check out https://github.com/dblock/opensearch-node-client-demo. Toggle between import and require in the demo.

What is the expected behavior?

VSCode should be resolving types all the time.

What is your host/environment?

Visual Studio Code w/ TypeScript.

Do you have any screenshots?

TODO

Do you have any additional context?

Seems to work with JetBrains.

@dblock
Copy link
Member Author

dblock commented Sep 10, 2024

@nhtruong What's the verdict on this one? Are we leaving it as is?

@nhtruong
Copy link
Collaborator

nhtruong commented Sep 10, 2024

JetBrains can still infer the type using require in both ts and js files.
Projects that use TS will most likely be using more modern JS syntax with import anyway.
I think we can close it as it's a VS Code issue for a very niche use case.

image

@dblock dblock closed this as completed Sep 10, 2024
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