Search code examples
htmlgulppug

Pug : unexpected_block Error


Hi All

I faced this error

PUG:UNEXPECTED_BLOCK

Pug Version : 5.6.0

Used Gulp for compiling

template.pug

//- Vars
- var siteName = "LandingPage" ;

block Vars

doctype html
html(lang="en")
    include head.pug
    body
        include header
        block content
        include footer
        include modals
        include scripts

index.pug

extends template/template

//- Vars
block vars
    - var pageTitle=" Home "; 
    - var pageDes="HTML App Landing Page Template";

//- Content
block content
    main
        include sections/content_section

Any Help ?

Note : I tried to

  • Remove the block vars that at template.pug but still gives me same error
  • Remove all comments form both according to this Answer but same

Solution

  • I solved the issue . The issue with the block names.

    At template.pug, It was named the block vars with **capitalize ** ( Vars )

    block Vars
    

    and at index.pug It was named with lowercase ( vars )

    block vars
    

    I fixed the block name at it works.

    Hope this help

    Thanks