-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
export statement in CookieControl component's <script setup> #146
Comments
The error should show in a minimal reproduction so that I can figure out the actual root cause.
Actually I've taken the export from Vue's documentation: https://vuejs.org/api/sfc-script-setup.html#default-props-values-when-using-type-declaration |
I guess that's the origin of the documentation that you used - https://github.com/vuejs/rfcs/blob/master/active-rfcs/0040-script-setup.md#default-props-values-when-using-type-declaration - and there is no export. As vue documentation states "A normal <script> may be needed in cases where we need to: [...] - Declaring named exports." Moreover if the interface is not imported anywhere, isn't it better to remove the "export" since it's not needed? |
I referenced the headline "Default props values when using type declaration" under https://vuejs.org/api/sfc-script-setup.html. The Vue documentation has some difficulties scrolling to the given title.
Maybe. Please create a minimal reproduction as noone else reported this issue since this module is used by dependents 🙏 Reproducing a failure is more actionable to me than a document link in this case. |
I managed to create a reproduction - https://stackblitz.com/edit/nuxt-starter-y79koj |
Thank you! Could you please make it minimal, i.e. let it only include nuxt and |
I've gone ahead and stripped other configuration and the development server starts fine this way: https://stackblitz.com/edit/nuxt-starter-72gc6p |
If you could figure out which other dependency makes the error pop, I'm trying to see if removing the export causes any other problem (dargmuesli/vio#94). |
Btw, the RFC's artifact in the Vue documentation was changed to resolve vuejs/docs#1678. I've created vuejs/docs#2532 to sort out what the proper way to fix this is. |
It looks like it's this dependency that causes the problem "vite-plugin-vue-type-imports". |
Environment
Darwin
v18.14.0
3.3.1
2.3.3
yarn@1.22.19
vite
-
-
-
Reproduction
The error doesn't show in reproduction template, but it seems obvious and the solution is even in vue docs.
Describe the bug
There is an export statement inside script setup tag in CookieControl.vue which causes app to crash.
It's this block:
The export should be in a separate script tag (like vue documentation suggests), or in somewhere in types.
Additional context
No response
Logs
The text was updated successfully, but these errors were encountered: