JADE trying to generate custom index causes error

I'm using the following template and trying to generate a custom index.html from enyo pack.

doctype html
html(lang="en")
head
meta(charset="utf-8")
meta(http-equiv="x-ua-compatible", content="ie=edge")
meta(name="viewport", content="width=device-width, initial-scale=1")
if devMode
title [DEVELOPMENT] #{title}
else
title= title
each stylesheet in stylesheets
if stylesheet.href
link(rel="stylesheet", href=stylesheet.href)
else
style!= stylesheet.contents
each script in scripts
if script.src
script(src=script.src)
else
script!= script.contents
body.enyo-unselectable

If I use this file as is (got it from the enyo git repository) everything is fine. The second I change the file in any way, I get the following error.

15:32:19.419Z FATAL enyo-dev: A fatal error has been encountered, please use "trace" logging for more information on this issue


All I did was add the following line below the last meta line.

meta(name="csrf", content="")

I've tried adding a bunch of simple things and it always results in an error. Trace does not provide any additional details. Any idea what the correct syntax is for adding this? Any way to get additoinal information about the error?

Comments

  • Appears you have the right idea. I copied your template above and included the CSRF tag and was able to build successfully with enyo pack -t index.tpl

    index.tpl
    doctype html
    html(lang="en")
    	head
    		meta(charset="utf-8")
    		meta(http-equiv="x-ua-compatible", content="ie=edge")
    		meta(name="viewport", content="width=device-width, initial-scale=1")
    		meta(name="csrf", content="")
    		if devMode
    			title [DEVELOPMENT] #{title}
    		else
    			title= title
    		each stylesheet in stylesheets
    			if stylesheet.href
    				link(rel="stylesheet", href=stylesheet.href)
    			else
    				style!= stylesheet.contents
    		each script in scripts
    			if script.src
    				script(src=script.src)
    			else
    				script!= script.contents
    	body.enyo-unselectable
    
  • I had a similar issue with modifying the file. It ended up being some issue with spacing (tabs vs 4 spaces). I had to copy and paste the "tabs" for it to work properly.
Sign In or Register to comment.