-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Importing TypeScript file from JavaScript file with the .js extension fails. #5999
Comments
This is Vite's limitation. It allows using |
Hey, the biggest problem with this is that it differentiates from how typescript is handling the same situation, so code that compiles just fine cannot be tested in the same way. Which for me was a big reason to drop jest for vitest in the first place. It sounds like I'd now have to convert every single If Vite does decide to keep it this way, is there anything we can do to get around it without migrating |
Unfortunate to see this not supported, but seems like it's being worked on here: vitejs/vite#8993 |
Doesn't work for |
Describe the bug
When I import a TypeScript file from within a JavaScript file like so
export { foo } from "./my-file.js";
(my-file is a .ts file on the FS). This should not error because TypeScript files can be imported using the JS extension.Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-ivcrw5?file=test%2Fbasic.test.ts
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: