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
<script>
let string = `here's some <strong>HTML!!!</strong>`;
</script>

<p>{@html string}</p>

Error compiling component

WebAssembly.instantiateStreaming(): value type opcode @+13
import 'svelte/internal/disclose-version';
import 'svelte/internal/flags/legacy';
import * as $ from 'svelte/internal/client';

var root = $.template(`<p><!></p>`);

export default function App($$anchor) {
let string = `here's some <strong>HTML!!!</strong>`;
var p = root();
var node = $.child(p);

$.html(node, () => string, false, false);
$.reset(p);
$.append($$anchor, p);
}
result = svelte.compile(source, {
generate: ,
});
/* Add a <style> tag to see the CSS output */
		
			
				
  • Root {
    • css: null
    • js: []
    • start: 74
    • end: 95
    • type: "Root"
    • fragment: Fragment {...}
      • type: "Fragment"
      • nodes: [...] (2)
        • Text {...}
          • type: "Text"
          • start: 72
          • end: 74
          • raw: "\n\n"
          • data: "\n\n"
          }
        • RegularElement {...}
          • type: "RegularElement"
          • start: 74
          • end: 95
          • name: "p"
          • attributes: []
          • fragment: Fragment {...}
            • type: "Fragment"
            • nodes: [...] (1)
              • HtmlTag {...}
                • type: "HtmlTag"
                • start: 77
                • end: 91
                • expression: Identifier {...}
                  • type: "Identifier"
                  • start: 84
                  • end: 90
                  • loc: {...}
                    • start: {...}
                      • line: 5
                      • column: 10
                      }
                    • end: {...}
                      • line: 5
                      • column: 16
                      }
                    }
                  • name: "string"
                  }
                }
              ]
            }
          }
        ]
      }
    • options: null
    • instance: Script {...}
      • type: "Script"
      • start: 0
      • end: 72
      • context: "default"
      • content: Program {...}
        • type: "Program"
        • start: 8
        • end: 63
        • loc: {...}
          • start: {...}
            • line: 1
            • column: 0
            }
          • end: {...}
            • line: 3
            • column: 0
            }
          }
        • body: [...] (1)
          • VariableDeclaration {...}
            • type: "VariableDeclaration"
            • start: 10
            • end: 62
            • loc: {...}
              • start: {...}
                • line: 2
                • column: 1
                }
              • end: {...}
                • line: 2
                • column: 53
                }
              }
            • declarations: [...] (1)
              • VariableDeclarator {...}
                • type: "VariableDeclarator"
                • start: 14
                • end: 61
                • loc: {...}
                  • start: {...}
                    • line: 2
                    • column: 5
                    }
                  • end: {...}
                    • line: 2
                    • column: 52
                    }
                  }
                • id: Identifier {...}
                  • type: "Identifier"
                  • start: 14
                  • end: 20
                  • loc: {...}
                    • start: {...}
                      • line: 2
                      • column: 5
                      }
                    • end: {...}
                      • line: 2
                      • column: 11
                      }
                    }
                  • name: "string"
                  }
                • init: TemplateLiteral {...}
                  • type: "TemplateLiteral"
                  • start: 23
                  • end: 61
                  • loc: {...}
                    • start: {...}
                      • line: 2
                      • column: 14
                      }
                    • end: {...}
                      • line: 2
                      • column: 52
                      }
                    }
                  • expressions: []
                  • quasis: [...] (1)
                    • TemplateElement {...}
                      • type: "TemplateElement"
                      • start: 24
                      • end: 60
                      • loc: {...}
                        • start: {...}
                          • line: 2
                          • column: 15
                          }
                        • end: {...}
                          • line: 2
                          • column: 51
                          }
                        }
                      • value: {...}
                        • raw: "here's some <strong>HTML!!!</strong>"
                        • cooked: "here's some <strong>HTML!!!</strong>"
                        }
                      • tail: true
                      }
                    ]
                  }
                }
              ]
            • kind: "let"
            }
          ]
        • sourceType: "module"
        }
      • attributes: []
      }
    }
The AST is not public API and may change at any point in time
HTML tags • Playground • Svelte