docs(sfc-script-setup): `<script setup>` cannot contain ES module exports
Nobody has claimed this yet.
- Dominant language
- Vue
- Stars
- 3.2k
- Forks
- 5k
- Avg merge
- 14d 17h
- Merged PRs (30d)
- 1
Description
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?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read src/api/sfc-script-setup.md, especially the section on usage alongside normal script, and compare it with commit 7ab399147c15abf232064ebf701552f07e00f638. Clarify the documentation around interface Props exports and named exports so the guidance is consistent with the reported compiler error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100