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
Info.svelte
<script>
import Info from './Info.svelte';

const pkg = {
name: 'svelte',
version: 3,
speed: 'blazing',
website: 'https://svelte.dev'
};
</script>

<Info {...pkg} />

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';
import Info from './Info.svelte';

export default function App($$anchor) {
const pkg = {
name: 'svelte',
version: 3,
speed: 'blazing',
website: 'https://svelte.dev'
};

Info($$anchor, $.spread_props(pkg));
}
result = svelte.compile(source, {
generate: ,
});
/* Add a <style> tag to see the CSS output */
		
			
				
  • Root {
    • css: null
    • js: []
    • start: 159
    • end: 176
    • type: "Root"
    • fragment: Fragment {...}
      • type: "Fragment"
      • nodes: [...] (2)
        • Text {...}
          • type: "Text"
          • start: 157
          • end: 159
          • raw: "\n\n"
          • data: "\n\n"
          }
        • Component {...}
          • type: "Component"
          • start: 159
          • end: 176
          • name: "Info"
          • attributes: [...] (1)
            • SpreadAttribute {...}
              • type: "SpreadAttribute"
              • start: 165
              • end: 173
              • expression: Identifier {...}
                • type: "Identifier"
                • start: 169
                • end: 172
                • loc: {...}
                  • start: {...}
                    • line: 12
                    • column: 10
                    }
                  • end: {...}
                    • line: 12
                    • column: 13
                    }
                  }
                • name: "pkg"
                }
              }
            ]
          • fragment: Fragment {...}
            • type: "Fragment"
            • nodes: []
            }
          }
        ]
      }
    • options: null
    • instance: Script {...}
      • type: "Script"
      • start: 0
      • end: 157
      • context: "default"
      • content: Program {...}
        • type: "Program"
        • start: 8
        • end: 148
        • loc: {...}
          • start: {...}
            • line: 1
            • column: 0
            }
          • end: {...}
            • line: 10
            • column: 0
            }
          }
        • body: [...] (2)
          • ImportDeclaration {...}
            • type: "ImportDeclaration"
            • start: 10
            • end: 43
            • loc: {...}
              • start: {...}
                • line: 2
                • column: 1
                }
              • end: {...}
                • line: 2
                • column: 34
                }
              }
            • specifiers: [...] (1)
              • ImportDefaultSpecifier {...}
                • type: "ImportDefaultSpecifier"
                • start: 17
                • end: 21
                • loc: {...}
                  • start: {...}
                    • line: 2
                    • column: 8
                    }
                  • end: {...}
                    • line: 2
                    • column: 12
                    }
                  }
                • local: Identifier {...}
                  • type: "Identifier"
                  • start: 17
                  • end: 21
                  • loc: {...}
                    • start: {...}
                      • line: 2
                      • column: 8
                      }
                    • end: {...}
                      • line: 2
                      • column: 12
                      }
                    }
                  • name: "Info"
                  }
                }
              ]
            • source: Literal {...}
              • type: "Literal"
              • start: 27
              • end: 42
              • loc: {...}
                • start: {...}
                  • line: 2
                  • column: 18
                  }
                • end: {...}
                  • line: 2
                  • column: 33
                  }
                }
              • value: "./Info.svelte"
              • raw: "'./Info.svelte'"
              }
            }
          • VariableDeclaration {...}
            • type: "VariableDeclaration"
            • start: 46
            • end: 147
            • loc: {...}
              • start: {...}
                • line: 4
                • column: 1
                }
              • end: {...}
                • line: 9
                • column: 3
                }
              }
            • declarations: [...] (1)
              • VariableDeclarator {...}
                • type: "VariableDeclarator"
                • start: 52
                • end: 146
                • loc: {...}
                  • start: {...}
                    • line: 4
                    • column: 7
                    }
                  • end: {...}
                    • line: 9
                    • column: 2
                    }
                  }
                • id: Identifier {...}
                  • type: "Identifier"
                  • start: 52
                  • end: 55
                  • loc: {...}
                    • start: {...}
                      • line: 4
                      • column: 7
                      }
                    • end: {...}
                      • line: 4
                      • column: 10
                      }
                    }
                  • name: "pkg"
                  }
                • init: ObjectExpression {...}
                  • type: "ObjectExpression"
                  • start: 58
                  • end: 146
                  • loc: {...}
                    • start: {...}
                      • line: 4
                      • column: 13
                      }
                    • end: {...}
                      • line: 9
                      • column: 2
                      }
                    }
                  • properties: [...] (4)
                    • Property {...}
                      • type: "Property"
                      • start: 62
                      • end: 76
                      • loc: {...}
                        • start: {...}
                          • line: 5
                          • column: 2
                          }
                        • end: {...}
                          • line: 5
                          • column: 16
                          }
                        }
                      • method: false
                      • shorthand: false
                      • computed: false
                      • key: Identifier {...}
                        • type: "Identifier"
                        • start: 62
                        • end: 66
                        • loc: {...}
                          • start: {...}
                            • line: 5
                            • column: 2
                            }
                          • end: {...}
                            • line: 5
                            • column: 6
                            }
                          }
                        • name: "name"
                        }
                      • value: Literal {...}
                        • type: "Literal"
                        • start: 68
                        • end: 76
                        • loc: {...}
                          • start: {...}
                            • line: 5
                            • column: 8
                            }
                          • end: {...}
                            • line: 5
                            • column: 16
                            }
                          }
                        • value: "svelte"
                        • raw: "'svelte'"
                        }
                      • kind: "init"
                      }
                    • Property {...}
                      • type: "Property"
                      • start: 80
                      • end: 90
                      • loc: {...}
                        • start: {...}
                          • line: 6
                          • column: 2
                          }
                        • end: {...}
                          • line: 6
                          • column: 12
                          }
                        }
                      • method: false
                      • shorthand: false
                      • computed: false
                      • key: Identifier {...}
                        • type: "Identifier"
                        • start: 80
                        • end: 87
                        • loc: {...}
                          • start: {...}
                            • line: 6
                            • column: 2
                            }
                          • end: {...}
                            • line: 6
                            • column: 9
                            }
                          }
                        • name: "version"
                        }
                      • value: Literal {...}
                        • type: "Literal"
                        • start: 89
                        • end: 90
                        • loc: {...}
                          • start: {...}
                            • line: 6
                            • column: 11
                            }
                          • end: {...}
                            • line: 6
                            • column: 12
                            }
                          }
                        • value: 3
                        • raw: "3"
                        }
                      • kind: "init"
                      }
                    • Property {...}
                      • type: "Property"
                      • start: 94
                      • end: 110
                      • loc: {...}
                        • start: {...}
                          • line: 7
                          • column: 2
                          }
                        • end: {...}
                          • line: 7
                          • column: 18
                          }
                        }
                      • method: false
                      • shorthand: false
                      • computed: false
                      • key: Identifier {...}
                        • type: "Identifier"
                        • start: 94
                        • end: 99
                        • loc: {...}
                          • start: {...}
                            • line: 7
                            • column: 2
                            }
                          • end: {...}
                            • line: 7
                            • column: 7
                            }
                          }
                        • name: "speed"
                        }
                      • value: Literal {...}
                        • type: "Literal"
                        • start: 101
                        • end: 110
                        • loc: {...}
                          • start: {...}
                            • line: 7
                            • column: 9
                            }
                          • end: {...}
                            • line: 7
                            • column: 18
                            }
                          }
                        • value: "blazing"
                        • raw: "'blazing'"
                        }
                      • kind: "init"
                      }
                    • Property {...}
                      • type: "Property"
                      • start: 114
                      • end: 143
                      • loc: {...}
                        • start: {...}
                          • line: 8
                          • column: 2
                          }
                        • end: {...}
                          • line: 8
                          • column: 31
                          }
                        }
                      • method: false
                      • shorthand: false
                      • computed: false
                      • key: Identifier {...}
                        • type: "Identifier"
                        • start: 114
                        • end: 121
                        • loc: {...}
                          • start: {...}
                            • line: 8
                            • column: 2
                            }
                          • end: {...}
                            • line: 8
                            • column: 9
                            }
                          }
                        • name: "website"
                        }
                      • value: Literal {...}
                        • type: "Literal"
                        • start: 123
                        • end: 143
                        • loc: {...}
                          • start: {...}
                            • line: 8
                            • column: 11
                            }
                          • end: {...}
                            • line: 8
                            • column: 31
                            }
                          }
                        • value: "https://svelte.dev"
                        • raw: "'https://svelte.dev'"
                        }
                      • kind: "init"
                      }
                    ]
                  }
                }
              ]
            • kind: "const"
            }
          ]
        • sourceType: "module"
        }
      • attributes: []
      }
    }
The AST is not public API and may change at any point in time
Spread props • Playground • Svelte