Skip to content

"An item with the same key has already been added" when using inline partial to pass data to partial #306

Description

@johnknoop

I'm trying to render this template:

{{#>my-layout}}{{#*inline"title"}}My title{{/inline}}
Some page content
{{/my-layout}}

This is the content of my-layout:

<html>
<head>
<title>{{>title}}</title>
</head>
<body>
{{>@partial-block}}
</body>
</html>

Exception:

Runtime error while rendering partial 'my-layout', see inner exception for more information

Inner exception:

An item with the same key has already been added. Key: title

Stack trace:

 at HandlebarsDotNet.Compiler.PartialBinder.InvokePartial(String partialName, BindingContext context, HandlebarsConfiguration configuration)
at HandlebarsDotNet.Compiler.PartialBinder.InvokePartialWithFallback(String partialName, BindingContext context, HandlebarsConfiguration configuration)
at HandlebarsDotNet.Handlebars.HandlebarsEnvironment.<>c__DisplayClass7_0.<Compile>b__0(Object context)

Any ideas?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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