compilerOptions whitespace: 'preserve' causes compiler error with named slots and default slot
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)
- Turn on compilerOptions: { whitespace: 'preserve' }.
- 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.