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

compilerOptions whitespace: 'preserve' causes compiler error with named slots and default slot #3766

Closed
tbtalbottjr opened this issue May 13, 2021 · 0 comments · Fixed by #3767
Labels
❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. 🐞 bug Something isn't working scope: compiler

Comments

@tbtalbottjr
Copy link

Version

3.1.0-beta.3

Reproduction link

https://codesandbox.io/s/tender-night-xbivj?file=/src/components/HelloWorld.vue

Steps to reproduce

(Note: Minimal reproduction is missing turning on compilerOptions: { whitespace: 'preserve' }. I've spent too much time trying to get it to be set in codesandbox.io. Any help appreciated)

  1. Turn on compilerOptions: { whitespace: 'preserve' }.
  2. Use a component that takes a named slot and a default slot formatted with a line break between the template tags.
    <slotted-component>
      <template #header> Test Header </template>
      <template #default> Test Default </template>
    </slotted-component>

What is expected?

Component to compile correctly.

What is actually happening?

VueCompilerError: Extraneous children found when component already has explicitly named default slot. These children will be ignored.


If you remove the line break between the template tags, the compiler is happy.

@HcySunYang HcySunYang added 🐞 bug Something isn't working ❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. scope: compiler labels May 13, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. 🐞 bug Something isn't working scope: compiler
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants