Issues with TS in dev mode after upgrade to vite-rails 3, vite 2.5.1 #122
-
I tried updating my app yesterday to latest of What appears to be happening is that the transpile output is not removing some or all of type imports, which causes a I realize that I can probably do a little more digging but it will have to wait at least a day. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi Keith, sorry to hear that. I've been using TypeScript in all recent projects, but I haven't faced a problem like that where esbuild does not remove TypeScript syntax. Do the files that fail use the standard extension Perhaps you can share your |
Beta Was this translation helpful? Give feedback.
-
I created a branch this morning for debugging, here are the steps I've taken:
AFAICT this gets me a clean, upgraded setup, and then I see the behavior. I confirm that import lines like: import { Foo, FooProps } from './foo'; are not transformed with this setup. import type { FooProps } from './foo'; is however removed from the output. I suspect a vite/esbuild bug at this point. I'll look through their issues again. |
Beta Was this translation helpful? Give feedback.
-
There's a similar (old) esbuild issue here: evanw/esbuild#341 I'm already using Ah, just found the issue, finally: evanw/esbuild#1525 So, definitively an esbuild bug with |
Beta Was this translation helpful? Give feedback.
There's a similar (old) esbuild issue here: evanw/esbuild#341
I'm already using
isolatedModules
, which doesn't seem relevant, as I'm seeing direct type exports hit this issue, with no type-reexports involved. Could probably work around this by separating type and value imports, but I'm not going to do that.Ah, just found the issue, finally: evanw/esbuild#1525
So, definitively an esbuild bug with
"importsNotUsedAsValues": "error"
(or"preserve"
I guess).