-
-
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
TypeScript type exports fail when type is imported from a module #731
Labels
Comments
Not sure if it's a bug or limitation of ESbuild, but changing it to either of these will work. import type { VNode } from 'vue';
export { VNode }; import { VNode } from 'vue';
export type { VNode }; |
Thanks! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
When exporting types in TypeScript that were imported from another library, transpiled file throws error about missing import.
There are no issues when using types from libraries or exporting locally created types, only when exporting types that were imported.
Reproduction
Demo repository: https://github.com/cyberalien/vite-ts-test
Run
npm install
andnpm run dev
to test it.Open it in browser, you should get this error:
This line in src/test.ts is triggering it:
If that line is removed, everything works fine.
It seem to happen with any exported types that are imported from third party libraries. Local types work fine. Imported types that are part of another local type, also works fine. It fails only when type imported from third party module is exported as is.
System Info
vite
version: 1.0.0-rc.4vue
version (fromyarn.lock
orpackage-lock.json
): 3.0.0-rc.7@vue/compiler-sfc
version: 3.0.0-rc.7Logs (Optional if provided reproduction)
vite
orvite build
with the--debug
flag.The text was updated successfully, but these errors were encountered: