You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
I have a similar issue. In my case I have a monorepo setup and during development I point the packages to the src. In one my packages the index.ts is as follows:
When I try importing this from vite it looks like it tries every extension combination but .tsx. For example, I added a console.log statement to the getTsSrcPath call:
Describe the bug
A feature was added recently which looks for
.ts
/.tsx
files based on imports ending in.js
/.jsx
. However, TypeScript does not export to.jsx
unless thejsx
mode is set topreserve
. Therefore, in a project importing./MyComponent.js
it will not resolve to./MyComponent.tsx
it will try and look for./MyComponent.ts
which does not exist.I believe the issue is here:
vite/packages/vite/src/node/utils.ts
Line 193 in 82e5016
.tsx
unless the import has.jsx
.Reproduction
https://stackblitz.com/edit/vitejs-vite-rzmfpt?file=main.tsx
System Info
Used Package Manager
yarn
Logs
Validations
The text was updated successfully, but these errors were encountered: