- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 4.7k
 
Closed
Labels
Description
Describe the bug
In Svelte 4, you could use bind:this with a dynamic type..
<script>
  let type = 'text';
  let el;
</script>
<input {type} bind:this={el} />but in Svelte 5 (runes or non-runes mode), this throws a compiler error: 'type' attribute must be a static text value if input uses two-way binding
This was explicitly checked and allowed in Svelte 4, so likely a regression.
Reproduction
- Svelte 4 REPL (works)
 - Svelte 5 REPL (error)
 
Logs
index-a870eda6.js:83 CompileError: 'type' attribute must be a static text value if input uses two-way binding
    at sr ([email protected]:1:226153)
    at BindDirective ([email protected]:1:502150)
    at r ([email protected]:1:305770)
    at o ([email protected]:1:305833)
    at r ([email protected]:1:305770)
    at o ([email protected]:1:305833)
    at Object.next ([email protected]:1:112832)
    at r ([email protected]:1:305753)
    at next ([email protected]:1:305809)
    at _ ([email protected]:1:305020)
### System Info
```shell
svelte: `5.0.0-next.15`
Severity
blocking an upgrade
