-
-
Notifications
You must be signed in to change notification settings - Fork 6.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 .mts file in config requires extension #18500
Comments
Trying to make a standalone repro, do you see something like this without
This behavior is from esbuild, but it looks like we can technically change it from |
Investigating this further, I'm not sure typescript supports extension-less import of @wmertens Can you elaborate what you wish to do in your Using |
@hi-ogawa Probably your stackblitz link is private, it shows a 404 for me. |
Ah, sorry. I started to let bolt.new create repro, but just realized it defaults to private one 🤦 I made all repros public now. |
@hi-ogawa yes that's the error I'm seeing. Note that I'm using the Bundler resolving for TS, so in the editor it's fine to import extensionless. Yes I think making vite call esbuild with the appropriate flags for mts resolution would be great. |
I couldn't make that work though. I tested on qwik repo using Can you explain more how you're making extensionless mts work? |
@hi-ogawa oh sorry I didn't realize that. I opened microsoft/TypeScript#60409 to handle that. In any case, telling esbuild about |
I think we can add this when TypeScript adds the support. I don't think it make sense to support this unless TypeScript supports it.
I don't think that is related to this issue. The behavior around that won't change even if importing |
Describe the bug
I'm using .mts for the vite config so I can use ESM plugins.
WHen I make a second config that imports the first, I need to add the
.mts
or it will not find it, and TS will complain and I have to add"allowImportingTsExtensions": true
to tsconfig, which can't always be done.Reproduction
https://github.com/QwikDev/qwik/blob/62cfd05cb20785e396a262648479df1a99d34b53/packages/docs/adapters/cloudflare-pages/vite.config.mts#L3-L4
Steps to reproduce
No response
System Info
System: OS: Linux 6.11 NixOS 24.11 (Vicuna) 24.11 (Vicuna) CPU: (16) x64 AMD Ryzen 7 7840HS with Radeon 780M Graphics Memory: 2.48 GB / 13.34 GB Container: Yes Shell: 5.2.32 - /run/current-system/sw/bin/bash Binaries: Node: 20.17.0 - /nix/store/dcdc33kdjdhjnzg6rkmd0cx4kpwl8cac-nodejs-20.17.0/bin/node npm: 10.8.2 - /nix/store/dcdc33kdjdhjnzg6rkmd0cx4kpwl8cac-nodejs-20.17.0/bin/npm pnpm: 9.1.2 - /nix/store/qsnvrzbi9dcrg6kfl4srjgg8jp613cxf-corepack-nodejs-20.17.0/bin/pnpm npmPackages: vite: 5.4.10 => 5.4.10
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: