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

importing ts files with js extension does not work #18

Closed
dominikg opened this issue May 23, 2022 · 0 comments · Fixed by #19 or esbuild-kit/cjs-loader#4
Closed

importing ts files with js extension does not work #18

dominikg opened this issue May 23, 2022 · 0 comments · Fixed by #19 or esbuild-kit/cjs-loader#4
Labels
bug Something isn't working outdated pr welcome

Comments

@dominikg
Copy link

dominikg commented May 23, 2022

a.ts

import './b.js' 

b.ts

console.log('hello from imported')

tsx a.ts results in an error that b.js cannot be found.

Expected behavior:
Resolve and transpile b.ts when importing as b.js

Additional info:
similar issue that was resolved in vite repo: vitejs/vite#6671
info in typescript repo why this is expected to work: microsoft/TypeScript#46452

This used to work in esmo, discovered it didn't when switching to tsx in vite-ecosystem-ci, workaround was to use b.ts instead for importing.

@privatenumber privatenumber added pr welcome bug Something isn't working labels May 23, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working outdated pr welcome
Projects
None yet
2 participants