I don't really know what causes it but here's my files
layout.pug
html
head
title My Site
body
block content
footer
p
| Some footer text
welcome.pug
extends layout
block content
h1 Welcome #{name}
When I comment out if statement which throws the exception it works fine but I don't think it will catch unexpected "extends" keyword...
vendor\phug\parser\src\Phug\Parser\TokenHandler\ImportTokenHandler.php line 35