With Symfony & Twig, when you inherit a block you cannot put some texts outside the defined block.
Let the "base.html.twig" (the one default in Symfony:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>{% block title %}Welcome!{% endblock %}</title>
{% block stylesheets %}{% endblock %}
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
</head>
<body>
{% block body %}{% endblock %}
{% block javascripts %}{% endblock %}
</body>
</html>
When you inherit this template, you can just fill the blocks sections.
This will work:
{% extends "::base.html.twig" %}
{% block body %}
Hello {{ name }}!
{% endblock %}
This wont work:
{% extends "::base.html.twig" %}
Extra text throwing error.
{% block body %}
Hello {{ name }}!
{% endblock %}