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
<p>Styled!</p>

<style>
p {
color: purple;
font-family: 'Comic Sans MS', cursive;
font-size: 2em;
}
</style>

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 class="svelte-urs9w7">Styled!</p>`);

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

$.append($$anchor, p);
}
result = svelte.compile(source, {
generate: ,
});

p.svelte-urs9w7 {
color: purple;
font-family: 'Comic Sans MS', cursive;
font-size: 2em;
}

		
			
				
  • Root {
    • css: StyleSheet {...}
      • type: "StyleSheet"
      • start: 16
      • end: 116
      • attributes: []
      • children: [...] (1)
        • Rule {...}
          • type: "Rule"
          • prelude: SelectorList {...}
            • type: "SelectorList"
            • start: 25
            • end: 26
            • children: [...] (1)
              • ComplexSelector {...}
                • type: "ComplexSelector"
                • start: 25
                • end: 26
                • children: [...] (1)
                  • RelativeSelector {...}
                    • type: "RelativeSelector"
                    • combinator: null
                    • selectors: [...] (1)
                      • TypeSelector {...}
                        • type: "TypeSelector"
                        • name: "p"
                        • start: 25
                        • end: 26
                        }
                      ]
                    • start: 25
                    • end: 26
                    }
                  ]
                }
              ]
            }
          • block: Block {...}
            • type: "Block"
            • start: 27
            • end: 107
            • children: [...] (3)
              • Declaration {...}
                • type: "Declaration"
                • start: 31
                • end: 44
                • property: "color"
                • value: "purple"
                }
              • Declaration {...}
                • type: "Declaration"
                • start: 48
                • end: 85
                • property: "font-family"
                • value: "'Comic Sans MS', cursive"
                }
              • Declaration {...}
                • type: "Declaration"
                • start: 89
                • end: 103
                • property: "font-size"
                • value: "2em"
                }
              ]
            }
          • start: 25
          • end: 107
          }
        ]
      • content: {...}
        • start: 23
        • end: 108
        • styles: "\n\tp {\n\t\tcolor: purple;\n\t\tfont-family: 'Comic Sans MS', cursive;\n\t\tfont-size: 2em;\n\t}\n"
        • comment: null
        }
      }
    • js: []
    • start: 0
    • end: 14
    • type: "Root"
    • fragment: Fragment {...}
      • type: "Fragment"
      • nodes: [...] (2)
        • RegularElement {...}
          • type: "RegularElement"
          • start: 0
          • end: 14
          • name: "p"
          • attributes: [...] (1)
            • Attribute {...}
              • type: "Attribute"
              • start: -1
              • end: -1
              • name: "class"
              • value: [...] (1)
                • Text {...}
                  • type: "Text"
                  • data: "svelte-urs9w7"
                  • raw: "svelte-urs9w7"
                  • start: -1
                  • end: -1
                  }
                ]
              }
            ]
          • fragment: Fragment {...}
            • type: "Fragment"
            • nodes: [...] (1)
              • Text {...}
                • type: "Text"
                • start: 3
                • end: 10
                • raw: "Styled!"
                • data: "Styled!"
                }
              ]
            }
          }
        • Text {...}
          • type: "Text"
          • start: 14
          • end: 16
          • raw: "\n\n"
          • data: "\n\n"
          }
        ]
      }
    • options: null
    }
The AST is not public API and may change at any point in time
Styling • Playground • Svelte