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
<svelte:head>
<link rel="stylesheet" href="/tutorial/dark-theme.css" />
</svelte:head>

<h1>Hello world!</h1>

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_1 = $.template(`<link rel="stylesheet" href="/tutorial/dark-theme.css">`);
var root = $.template(`<h1>Hello world!</h1>`);

export default function App($$anchor) {
var h1 = root();

$.head(($$anchor) => {
var link = root_1();

$.append($$anchor, link);
});

$.append($$anchor, h1);
}
result = svelte.compile(source, {
generate: ,
});
/* Add a <style> tag to see the CSS output */
		
			
				
  • Root {
    • css: null
    • js: []
    • start: 0
    • end: 110
    • type: "Root"
    • fragment: Fragment {...}
      • type: "Fragment"
      • nodes: [...] (3)
        • SvelteHead {...}
          • type: "SvelteHead"
          • start: 0
          • end: 87
          • name: "svelte:head"
          • attributes: []
          • fragment: Fragment {...}
            • type: "Fragment"
            • nodes: [...] (3)
              • Text {...}
                • type: "Text"
                • start: 13
                • end: 15
                • raw: "\n\t"
                • data: "\n\t"
                }
              • RegularElement {...}
                • type: "RegularElement"
                • start: 15
                • end: 72
                • name: "link"
                • attributes: [...] (2)
                  • Attribute {...}
                    • type: "Attribute"
                    • start: 21
                    • end: 37
                    • name: "rel"
                    • value: [...] (1)
                      • Text {...}
                        • start: 26
                        • end: 36
                        • type: "Text"
                        • raw: "stylesheet"
                        • data: "stylesheet"
                        }
                      ]
                    }
                  • Attribute {...}
                    • type: "Attribute"
                    • start: 38
                    • end: 69
                    • name: "href"
                    • value: [...] (1)
                      • Text {...}
                        • start: 44
                        • end: 68
                        • type: "Text"
                        • raw: "/tutorial/dark-theme.css"
                        • data: "/tutorial/dark-theme.css"
                        }
                      ]
                    }
                  ]
                • fragment: Fragment {...}
                  • type: "Fragment"
                  • nodes: []
                  }
                }
              • Text {...}
                • type: "Text"
                • start: 72
                • end: 73
                • raw: "\n"
                • data: "\n"
                }
              ]
            }
          }
        • Text {...}
          • type: "Text"
          • start: 87
          • end: 89
          • raw: "\n\n"
          • data: "\n\n"
          }
        • RegularElement {...}
          • type: "RegularElement"
          • start: 89
          • end: 110
          • name: "h1"
          • attributes: []
          • fragment: Fragment {...}
            • type: "Fragment"
            • nodes: [...] (1)
              • Text {...}
                • type: "Text"
                • start: 93
                • end: 105
                • raw: "Hello world!"
                • data: "Hello world!"
                }
              ]
            }
          }
        ]
      }
    • options: null
    }
The AST is not public API and may change at any point in time
<svelte:head> • Playground • Svelte