Search code examples
pugkeystone

Unexpected token `tag` expected in pug


I am working with pug in keystone and while adding side navigation i am getting error like this.

> 6| a(href="#")About
--------------------^
7| a(href="#")Services
8| a(href="#")Client
9| a(href="#")Contact

Unexpected token `tag` expected `text`, `interpolated-code`, `code`, `:`, `slash`, `newline` or `eos`

Solution

  • There needs to be a space between the tag/attributes and its content (after the closing parentheses) in order for it to be valid Pug:

    a(href='#') About
    

    More examples in the documentation on using tags with attributes in Pug