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
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: