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

When importing module with js extension also try to resolve corresponding module with tsx extension #6015

Closed
4 tasks done
renke opened this issue Dec 8, 2021 · 2 comments
Closed
4 tasks done

Comments

@renke
Copy link

renke commented Dec 8, 2021

Clear and concise description of the problem

A similar functionality was already implemented in #5510 but the implementation only tries once to either resolve $module.ts or $module.tsx (depending on the extension used in the import).

TypeScript typecheck does not complain when using .js and there only exist a corresponding .tsx module. So Vite would behave closer to how TypeScript works when this would be implemented, following basically the same reasoning as in the aforementioned merged PR.

Suggested solution

Vite could also try to resolve a module using .tsx (instead of only .ts) even if the import uses just .js.

Alternative

No response

Additional context

No response

Validations

@radoslavkarlik
Copy link

I have also encountered this when migrating a project to vite. Is there any workout currently?

@renke
Copy link
Author

renke commented Mar 13, 2022

This seems to be no longer a problem as of version 2.9.0-beta.0. Thank you!

@renke renke closed this as completed Mar 13, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants