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

Error when migrating from Vue CLI to Vite: missing .vue extension in imports #1

Closed
acabreragnz opened this issue Sep 21, 2024 · 1 comment

Comments

@acabreragnz
Copy link

acabreragnz commented Sep 21, 2024

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

I encountered an error while migrating from Vue CLI to Vite. The issue is that, by design, Vite requires the .vue extension in imports.
vitejs/vite#178 (comment)

image

Here is the diff that solved my problem:

diff --git a/node_modules/vue-headings/src/index.js b/node_modules/vue-headings/src/index.js
index 68ccde0..54375a3 100644
--- a/node_modules/vue-headings/src/index.js
+++ b/node_modules/vue-headings/src/index.js
@@ -1,2 +1,2 @@
-export { default as DocumentHeading } from "./document-heading";
-export { default as DocumentSection } from "./document-section";
+export { default as DocumentHeading } from "./document-heading.vue";
+export { default as DocumentSection } from "./document-section.vue";

This issue body was partially generated by patch-package.

@mcibique
Copy link
Owner

Hi, thanks for reporting 👍 . I have updated the imports and tested it with vite and vitest, should be all good now.

The fix has been released in 1.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants