1
votes

I wrote a jade file as shown below:

extends layout

block content
  h1= title
  p Welcome 123 to #{title}

block scripts
  script(src='/socket.io/socket.io.js')
  script(src='/javascripts/client.js')

However when I run I get the following Warning: Warning: Unexpected block "scripts" This block is never used. This warning will be an error in v2.0.0

My Package.json file has jade version ~1.9.0

However this works when Jade version is ~1.8.2

What could be the problem?

2
Can you post your Layout file? - Jay Harris
It seems that I ran into the same problem. Try to put an empty line after the block definition in the layout file or provide it with some default value. This solved the issue for me. - Alex Kreimer

2 Answers

3
votes

You should add the line: block scripts to your layout.jade file.

0
votes

I was having the same error and was a typo with the spaces mixed with tabs. Try to remove all the spaces and add again. It worked with me: block conten*th*1= titlep Welcome 123 to #{title} Press enter between the th, ep and then add spaces to indent. I hope that helps.