You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After installing the drawer component and adding it to my page, Vite gave me the following error:
11:39:23 AM [vite] (client) Pre-transform error: [@vue/compiler-sfc] Failed to resolve import source "radix-vue".
C:/Users/x/Projects/drawer-bug/drawer-bug/node_modules/vaul-vue/dist/index.d.ts
3 | import DrawerOverlay from "./DrawerOverlay";
4 | import DrawerContent from "./DrawerContent";
5 | export type { DrawerRootEmits, DrawerRootProps, } from './controls';
| ^^^^^^^^^^^^^^^^^^^^^^
6 | export type { SnapPoint, DrawerDirection, } from './types';
7 | export { DrawerRoot, DrawerRootNested, DrawerOverlay, DrawerContent, };
Plugin: vite:vue
File: C:/Users/x/Projects/drawer-bug/drawer-bug/src/components/ui/drawer/DrawerDescription.vue
11:39:23 AM [vite] (client) Pre-transform error: [@vue/compiler-sfc] Failed to resolve import source "radix-vue".
C:/Users/x/Projects/drawer-bug/drawer-bug/node_modules/vaul-vue/dist/index.d.ts
3 | import DrawerOverlay from "./DrawerOverlay";
4 | import DrawerContent from "./DrawerContent";
5 | export type { DrawerRootEmits, DrawerRootProps, } from './controls';
| ^^^^^^^^^^^^^^^^
6 | export type { SnapPoint, DrawerDirection, } from './types';
7 | export { DrawerRoot, DrawerRootNested, DrawerOverlay, DrawerContent, };
Plugin: vite:vue
File: C:/Users/x/Projects/drawer-bug/drawer-bug/src/components/ui/drawer/DrawerTitle.vue
11:39:23 AM [vite] Internal server error: [@vue/compiler-sfc] Failed to resolve import source "radix-vue".
C:/Users/x/Projects/drawer-bug/drawer-bug/node_modules/vaul-vue/dist/index.d.ts
3 | import DrawerOverlay from "./DrawerOverlay";
4 | import DrawerContent from "./DrawerContent";
5 | export type { DrawerRootEmits, DrawerRootProps, } from './controls';
| ^^^^^^^^^^^^^^^^^^^^^^
6 | export type { SnapPoint, DrawerDirection, } from './types';
7 | export { DrawerRoot, DrawerRootNested, DrawerOverlay, DrawerContent, };
Plugin: vite:vue
File: C:/Users/x/Projects/drawer-bug/drawer-bug/src/components/ui/drawer/DrawerDescription.vue
at ScriptCompileContext.error (C:\Users\x\Projects\drawer-bug\drawer-bug\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:19741:11)
at importSourceToScope (C:\Users\x\Projects\drawer-bug\drawer-bug\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:22626:16)
at resolveTypeFromImport (C:\Users\x\Projects\drawer-bug\drawer-bug\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:22579:23)
at innerResolveTypeReference (C:\Users\x\Projects\drawer-bug\drawer-bug\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:22466:14)
at resolveTypeReference (C:\Users\x\Projects\drawer-bug\drawer-bug\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:22454:20)
at resolveTypeFromImport (C:\Users\x\Projects\drawer-bug\drawer-bug\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:22580:10)
at innerResolveTypeReference (C:\Users\x\Projects\drawer-bug\drawer-bug\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:22466:14)
at resolveTypeReference (C:\Users\x\Projects\drawer-bug\drawer-bug\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:22454:20)
at innerResolveTypeElements (C:\Users\x\Projects\drawer-bug\drawer-bug\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:22055:24)
at resolveTypeElements (C:\Users\x\Projects\drawer-bug\drawer-bug\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:21995:20)
11:39:24 AM [vite] Internal server error: [@vue/compiler-sfc] Failed to resolve import source "radix-vue".
C:/Users/x/Projects/drawer-bug/drawer-bug/node_modules/vaul-vue/dist/index.d.ts
3 | import DrawerOverlay from "./DrawerOverlay";
4 | import DrawerContent from "./DrawerContent";
5 | export type { DrawerRootEmits, DrawerRootProps, } from './controls';
| ^^^^^^^^^^^^^^^^
6 | export type { SnapPoint, DrawerDirection, } from './types';
7 | export { DrawerRoot, DrawerRootNested, DrawerOverlay, DrawerContent, };
Plugin: vite:vue
File: C:/Users/x/Projects/drawer-bug/drawer-bug/src/components/ui/drawer/DrawerTitle.vue
at ScriptCompileContext.error (C:\Users\x\Projects\drawer-bug\drawer-bug\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:19741:11)
at importSourceToScope (C:\Users\x\Projects\drawer-bug\drawer-bug\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:22626:16)
at resolveTypeFromImport (C:\Users\x\Projects\drawer-bug\drawer-bug\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:22579:23)
at innerResolveTypeReference (C:\Users\x\Projects\drawer-bug\drawer-bug\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:22466:14)
at resolveTypeReference (C:\Users\x\Projects\drawer-bug\drawer-bug\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:22454:20)
at resolveTypeFromImport (C:\Users\x\Projects\drawer-bug\drawer-bug\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:22580:10)
at innerResolveTypeReference (C:\Users\x\Projects\drawer-bug\drawer-bug\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:22466:14)
at resolveTypeReference (C:\Users\x\Projects\drawer-bug\drawer-bug\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:22454:20)
at innerResolveTypeElements (C:\Users\x\Projects\drawer-bug\drawer-bug\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:22055:24)
at resolveTypeElements (C:\Users\x\Projects\drawer-bug\drawer-bug\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:21995:20)
After hours of desperate searching and hair-pulling, I discovered that my tsconfig.json had "target": "es2022" set in compilerOptions. Sure enough, removing that line caused the error to go away. I don't exactly remember why I had set it to es2022 in the first place, but regardless, that was the source of the issue.
The StackBlitz reproduction does not give exactly the same error message, but it behaves the same way regardless. The error message posted here was obtained after creating a new Vue project with npm create vue@latest, following the shadcn setup instructions, installing Drawer, and changing tsconfig.json.
Reproduction
https://stackblitz.com/edit/shadcn-drawer-bug?file=tsconfig.json
Describe the bug
After installing the drawer component and adding it to my page, Vite gave me the following error:
After hours of desperate searching and hair-pulling, I discovered that my
tsconfig.json
had"target": "es2022"
set incompilerOptions
. Sure enough, removing that line caused the error to go away. I don't exactly remember why I had set it to es2022 in the first place, but regardless, that was the source of the issue.The StackBlitz reproduction does not give exactly the same error message, but it behaves the same way regardless. The error message posted here was obtained after creating a new Vue project with
npm create vue@latest
, following the shadcn setup instructions, installing Drawer, and changingtsconfig.json
.System Info
Contributes
The text was updated successfully, but these errors were encountered: