Skip to content

Compiler error in 3.20.0 with certain slot usage #4562

@Conduitry

Description

@Conduitry

Describe the bug
As of 3.20.0, the compiler is now throwing an exception when compiling certain slot usages.

Logs
Compile time exception: Variable 't' already initialised with a different value

To Reproduce

<slot>
	<div title={foo}>foo</div>
	<div>bar</div>
</slot>

Expected behavior
This compiles without an exception.

Stacktraces

Stack trace
Error: Variable 't' already initialised with a different value
    at Block$1.add_variable (.../src/compiler/compile/render_dom/Block.ts:210:10)
    at Block$1.add_element (.../src/compiler/compile/render_dom/Block.ts:177:8)
    at TextWrapper.render (.../src/compiler/compile/render_dom/wrappers/Text.ts:47:9)
    at FragmentWrapper.render (.../src/compiler/compile/render_dom/wrappers/Fragment.ts:147:18)
    at SlotWrapper.render (.../src/compiler/compile/render_dom/wrappers/Slot.ts:117:18)        
    at FragmentWrapper.render (.../src/compiler/compile/render_dom/wrappers/Fragment.ts:147:18)
    at new Renderer (.../src/compiler/compile/render_dom/Renderer.ts:101:17)
    at dom (.../src/compiler/compile/render_dom/index.ts:17:19)
    at Object.render_dom [as compile] (.../src/compiler/compile/index.ts:97:6)

Information about your Svelte project:

  • Svelte 3.20.0
  • REPL

Severity
Unknown.

Additional context
Mentioned in Discord here.

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