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

fix: ensure ref-macros export plays nice with vue-tsc #5003

merged 1 commit into from Dec 6, 2021


Copy link

@LinusBorg LinusBorg commented Nov 26, 2021

The fix in 1245709 seems incomplete - it works in VSCode, but vue-tsc still throws:

vue-tsc --noEmit && vite build
src/env.d.ts:2:23 - error TS2688: Cannot find type definition file for 'vue/ref-macros'.
2 /// <reference types="vue/ref-macros" />

it seems that the "exports" entry for the ref-macros should not have the .d.ts extension:

  "exports": {
    // ....
    "./dist/*": "./dist/*",
    "./package.json": "./package.json",
-    "./ref-macros.d.ts": "./ref-macros.d.ts"
+    "./ref-macros": "./ref-macros.d.ts"

Doing that change in an actual plain vite project and running build works without throwing an error.

I used:

@LinusBorg LinusBorg changed the title fix: ensure re-macros export plays nice with vue-tsc fix: ensure ref-macros export plays nice with vue-tsc Nov 26, 2021
@LinusBorg LinusBorg force-pushed the linusborg/fix-vue-macros-export branch from dc3a021 to d00074e Compare November 26, 2021 11:59
@yyx990803 yyx990803 merged commit f855269 into master Dec 6, 2021
@yyx990803 yyx990803 deleted the linusborg/fix-vue-macros-export branch December 6, 2021 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants