Skip to main content
Create new
Introduction
Reactivity
Props
Logic
Events
Bindings
Lifecycle
Stores
Motion
Transitions
Animations
Easing
SVG
Actions
Classes
Component composition
Context API
Special elements
Module context
Debugging
7GUIs
Miscellaneous
App.svelte
Slotted.svelte
<script>
import Slotted from './Slotted.svelte';
let name = 'world';
</script>

<h1>Hello {name}!</h1>

<Slotted let:set let:key>
<button type="button" on:click={() => set(`value-${key}`)}>Set {key}</button>
</Slotted>

Error compiling component

WebAssembly.instantiateStreaming(): value type opcode @+13
/* App.svelte generated by Svelte v3.29.5 */
import {
SvelteComponent,
append,
attr,
create_component,
destroy_component,
detach,
element,
init,
insert,
listen,
mount_component,
safe_not_equal,
set_data,
space,
text,
transition_in,
transition_out
} from "svelte/internal";

import Slotted from "./Slotted.svelte";

function create_default_slot(ctx) {
let button;
let t0;
let t1_value = /*key*/ ctx[2] + "";
let t1;
let mounted;
let dispose;

function click_handler() {
return /*click_handler*/ ctx[0](/*set*/ ctx[1], /*key*/ ctx[2]);
}

return {
result = svelte.compile(source, {
generate: ,
});
/* Add a <style> tag to see the CSS output */
		
			
				
  • {
    • html: Fragment {...}
      • start: 82
      • end: 221
      • type: "Fragment"
      • children: [...] (4)
        • Text {...}
          • start: 80
          • end: 82
          • type: "Text"
          • raw: "\n\n"
          • data: "\n\n"
          }
        • Element {...}
          • start: 82
          • end: 104
          • type: "Element"
          • name: "h1"
          • attributes: []
          • children: [...] (3)
            • Text {...}
              • start: 86
              • end: 92
              • type: "Text"
              • raw: "Hello "
              • data: "Hello "
              }
            • MustacheTag {...}
              • start: 92
              • end: 98
              • type: "MustacheTag"
              • expression: Identifier {...}
                • type: "Identifier"
                • start: 93
                • end: 97
                • loc: {...}
                  • start: {...}
                    • line: 6
                    • column: 11
                    }
                  • end: {...}
                    • line: 6
                    • column: 15
                    }
                  }
                • name: "name"
                }
              }
            • Text {...}
              • start: 98
              • end: 99
              • type: "Text"
              • raw: "!"
              • data: "!"
              }
            ]
          }
        • Text {...}
          • start: 104
          • end: 106
          • type: "Text"
          • raw: "\n\n"
          • data: "\n\n"
          }
        • InlineComponent {...}
          • start: 106
          • end: 221
          • type: "InlineComponent"
          • name: "Slotted"
          • attributes: [...] (2)
            • Let {...}
              • start: 115
              • end: 122
              • type: "Let"
              • name: "set"
              • modifiers: []
              • expression: null
              }
            • Let {...}
              • start: 123
              • end: 130
              • type: "Let"
              • name: "key"
              • modifiers: []
              • expression: null
              }
            ]
          • children: [...] (3)
            • Text {...}
              • start: 131
              • end: 133
              • type: "Text"
              • raw: "\n\t"
              • data: "\n\t"
              }
            • Element {...}
              • start: 133
              • end: 210
              • type: "Element"
              • name: "button"
              • attributes: [...] (2)
                • Attribute {...}
                  • start: 141
                  • end: 154
                  • type: "Attribute"
                  • name: "type"
                  • value: [...] (1)
                    • Text {...}
                      • start: 147
                      • end: 153
                      • type: "Text"
                      • raw: "button"
                      • data: "button"
                      }
                    ]
                  }
                • EventHandler {...}
                  • start: 155
                  • end: 191
                  • type: "EventHandler"
                  • name: "click"
                  • modifiers: []
                  • expression: ArrowFunctionExpression {...}
                    • type: "ArrowFunctionExpression"
                    • start: 165
                    • end: 190
                    • loc: {...}
                      • start: {...}
                        • line: 9
                        • column: 33
                        }
                      • end: {...}
                        • line: 9
                        • column: 58
                        }
                      }
                    • id: null
                    • expression: true
                    • generator: false
                    • async: false
                    • params: [...] (2)
                      • Identifier {...}
                        • type: "Identifier"
                        • name: "set"
                        }
                      • Identifier {...}
                        • type: "Identifier"
                        • name: "key"
                        }
                      ]
                    • body: CallExpression {...}
                      • type: "CallExpression"
                      • start: 171
                      • end: 190
                      • loc: {...}
                        • start: {...}
                          • line: 9
                          • column: 39
                          }
                        • end: {...}
                          • line: 9
                          • column: 58
                          }
                        }
                      • callee: Identifier {...}
                        • type: "Identifier"
                        • start: 171
                        • end: 174
                        • loc: {...}
                          • start: {...}
                            • line: 9
                            • column: 39
                            }
                          • end: {...}
                            • line: 9
                            • column: 42
                            }
                          }
                        • name: "set"
                        }
                      • arguments: [...] (1)
                        • TemplateLiteral {...}
                          • type: "TemplateLiteral"
                          • start: 175
                          • end: 189
                          • loc: {...}
                            • start: {...}
                              • line: 9
                              • column: 43
                              }
                            • end: {...}
                              • line: 9
                              • column: 57
                              }
                            }
                          • expressions: [...] (1)
                            • Identifier {...}
                              • type: "Identifier"
                              • start: 184
                              • end: 187
                              • loc: {...}
                                • start: {...}
                                  • line: 9
                                  • column: 52
                                  }
                                • end: {...}
                                  • line: 9
                                  • column: 55
                                  }
                                }
                              • name: "key"
                              }
                            ]
                          • quasis: [...] (2)
                            • TemplateElement {...}
                              • type: "TemplateElement"
                              • start: 176
                              • end: 182
                              • loc: {...}
                                • start: {...}
                                  • line: 9
                                  • column: 44
                                  }
                                • end: {...}
                                  • line: 9
                                  • column: 50
                                  }
                                }
                              • value: {...}
                                • raw: "value-"
                                • cooked: "value-"
                                }
                              • tail: false
                              }
                            • TemplateElement {...}
                              • type: "TemplateElement"
                              • start: 188
                              • end: 188
                              • loc: {...}
                                • start: {...}
                                  • line: 9
                                  • column: 56
                                  }
                                • end: {...}
                                  • line: 9
                                  • column: 56
                                  }
                                }
                              • value: {...}
                                • raw: ""
                                • cooked: ""
                                }
                              • tail: true
                              }
                            ]
                          }
                        ]
                      • optional: false
                      }
                    }
                  }
                ]
              • children: [...] (2)
                • Text {...}
                  • start: 192
                  • end: 196
                  • type: "Text"
                  • raw: "Set "
                  • data: "Set "
                  }
                • MustacheTag {...}
                  • start: 196
                  • end: 201
                  • type: "MustacheTag"
                  • expression: Identifier {...}
                    • type: "Identifier"
                    • start: 197
                    • end: 200
                    • loc: {...}
                      • start: {...}
                        • line: 9
                        • column: 65
                        }
                      • end: {...}
                        • line: 9
                        • column: 68
                        }
                      }
                    • name: "key"
                    }
                  }
                ]
              }
            • Text {...}
              • start: 210
              • end: 211
              • type: "Text"
              • raw: "\n"
              • data: "\n"
              }
            ]
          }
        ]
      }
    • css: undefined
    • instance: Script {...}
      • type: "Script"
      • start: 0
      • end: 80
      • context: "default"
      • content: Program {...}
        • type: "Program"
        • start: 8
        • end: 71
        • loc: {...}
          • start: {...}
            • line: 1
            • column: 0
            }
          • end: {...}
            • line: 4
            • column: 0
            }
          }
        • body: [...] (2)
          • ImportDeclaration {...}
            • type: "ImportDeclaration"
            • start: 10
            • end: 49
            • loc: {...}
              • start: {...}
                • line: 2
                • column: 1
                }
              • end: {...}
                • line: 2
                • column: 40
                }
              }
            • specifiers: [...] (1)
              • ImportDefaultSpecifier {...}
                • type: "ImportDefaultSpecifier"
                • start: 17
                • end: 24
                • loc: {...}
                  • start: {...}
                    • line: 2
                    • column: 8
                    }
                  • end: {...}
                    • line: 2
                    • column: 15
                    }
                  }
                • local: Identifier {...}
                  • type: "Identifier"
                  • start: 17
                  • end: 24
                  • loc: {...}
                    • start: {...}
                      • line: 2
                      • column: 8
                      }
                    • end: {...}
                      • line: 2
                      • column: 15
                      }
                    }
                  • name: "Slotted"
                  }
                }
              ]
            • source: Literal {...}
              • type: "Literal"
              • start: 30
              • end: 48
              • loc: {...}
                • start: {...}
                  • line: 2
                  • column: 21
                  }
                • end: {...}
                  • line: 2
                  • column: 39
                  }
                }
              • value: "./Slotted.svelte"
              • raw: "'./Slotted.svelte'"
              }
            }
          • VariableDeclaration {...}
            • type: "VariableDeclaration"
            • start: 51
            • end: 70
            • loc: {...}
              • start: {...}
                • line: 3
                • column: 1
                }
              • end: {...}
                • line: 3
                • column: 20
                }
              }
            • declarations: [...] (1)
              • VariableDeclarator {...}
                • type: "VariableDeclarator"
                • start: 55
                • end: 69
                • loc: {...}
                  • start: {...}
                    • line: 3
                    • column: 5
                    }
                  • end: {...}
                    • line: 3
                    • column: 19
                    }
                  }
                • id: Identifier {...}
                  • type: "Identifier"
                  • start: 55
                  • end: 59
                  • loc: {...}
                    • start: {...}
                      • line: 3
                      • column: 5
                      }
                    • end: {...}
                      • line: 3
                      • column: 9
                      }
                    }
                  • name: "name"
                  }
                • init: Literal {...}
                  • type: "Literal"
                  • start: 62
                  • end: 69
                  • loc: {...}
                    • start: {...}
                      • line: 3
                      • column: 12
                      }
                    • end: {...}
                      • line: 3
                      • column: 19
                      }
                    }
                  • value: "world"
                  • raw: "'world'"
                  }
                }
              ]
            • kind: "let"
            }
          ]
        • sourceType: "module"
        }
      }
    • module: undefined
    }
The AST is not public API and may change at any point in time