docs icon indicating copy to clipboard operation
docs copied to clipboard

docs(sfc-script-setup): `<script setup>` cannot contain ES module exports

Open dargmuesli opened this issue 2 years ago • 1 comments

Commit https://github.com/vuejs/docs/commit/7ab399147c15abf232064ebf701552f07e00f638 fixed issue #1678 by introducing an export to the interface Props. This export clashes with a specification in the same file, I think, which states:

A normal <script> may be needed in cases where we need to: [...] Declaring named exports.

This can seemingly lead to a new issue with [plugin:vite:vue] [@vue/compiler-sfc]: <script setup> cannot contain ES module exports. If you are using a previous version of <script setup>, please consult the updated RFC at https://github.com/vuejs/rfcs/pull/227.

What's the proper way to resolve this issue? What am I missing?

dargmuesli avatar Oct 11 '23 16:10 dargmuesli

Hey @NataliaTepluhina, the commit I mentioned above is by you, so maybe you can assist to resolve this issue? :pray:

dargmuesli avatar Jun 23 '24 23:06 dargmuesli