Skip to content

Error using multiple dynamic slot names (Invalid dynamic argument expression) #9781

Closed
@tanasebutcaru

Description

@tanasebutcaru

Version

2.6.10

Reproduction link

https://github.com/tbutcaru/v-issue-multiple-dynamic-slot-names

Steps to reproduce

  1. Clone this repo: https://github.com/tbutcaru/v-issue-multiple-dynamic-slot-names
  2. Run: npm install
  3. Run: npm run serve

What is expected?

Multiple dynamic slot names should work as expected.

What is actually happening?

The following error is thrown:

Invalid dynamic argument expression: attribute names cannot contain spaces, quotes, <, >, / or =.#[headerslot]>Header slot</template>
    Default slot
    <template #[footerslot]

If one of the dynamic slot names is made static (doesn't matter which), the application is working.

My investigation
  • file: node_modules/vue-template-compiler/build.js
  • line: 2563 (inside attrs.forEach(function (attr) {) added the following warn:
warn$1('--------------->> ' +  attr.name);
Investigation results:
  1. In the working scenario with only one dynamic slot name: the value of that dynamic slot name is #[headerslot]
  2. In the error scenario with two dynamic slot names: the value of the first dynamic slot name is
#[headerslot]>Header slot</template>
    Default slot
    <template #[footerslot]

So, it looks like the compiler doesn't know how to extract just the attribute when there are multiple dynamic slot names.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions