You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting this strange error when running harp compile in my project.
{
"source": "Jade",
"dest": "HTML",
"filename": "./node_modules/harp/lib/templates/_layout.jade",
"lineno": 129,
"name": "TypeError",
"message": "Cannot read property 'version' of undefined",
"stack": "doctype\nhtml(lang=\"en\")\n\thead\n\t\tmeta(charset=\"utf-8\")\n\t\tmeta(http-equiv=\"X-UA-Compatible\", content=\"IE=edge,chrome=1\")\n\t\t//- title #{ pkg.name } #{ pkg.version }\n\t\ttitle Harp\n\t\tmeta(name=\"handheldfriendly\", content=\"true\")\n\t\tmeta(name=\"mobileoptimized\", content=\"320\")\n\t\tmeta(name=\"viewport\", content=\"width=device-width, initial-scale=1.0\")\n\t\tmeta(http-equiv=\"cleartype\", content=\"on\")\n\t\tstyle.\n\t\t\tbody {\n\t\t\t\tfont-family: Verdana;\n\t\t\t\tpadding:10px 10px;\n\t\t\t}\n\n\t\t\th1, h2, h3, h4, h5, h6{\n\t\t\t\tfont-weight: 300;\n\t\t\t\tline-height: 1.5em;\n\t\t\t}\n\n\t\t\th3 {\n\t\t\t\tfont-weight: 500;\n\t\t\t\tfont-size: 1em;\n\t\t\t}\n\n\t\t\tp {\n\t\t\t\tfont-size: 1em;\n\t\t\t\tline-height: 1.5em;\n\t\t\t}\n\n\t\t\theader{\n\t\t\t\tpadding:20px 0px;\n\t\t\t}\n\n\t\t\theader h1{\n\t\t\t\tmargin:0;\n\t\t\t}\n\n\t\t\theader h3{\n\t\t\t\tmargin:0;\n\t\t\t}\n\n\t\t\t.stacktrace{\n\t\t\t\tpadding:0px;\n\t\t\t\tmargin-bottom:20px;\n\t\t\t\tmargin-top:40px;\n\t\t\t\tborder:2px solid #a44;\n\t\t\t\tbackground:#a44;\n\t\t\t}\n\n\t\t\t.stacktrace h3{\n\t\t\t\tpadding:22px 0px 20px 10px;\n\t\t\t\tcolor: #fff;\n\t\t\t\tmargin:0px;\n\t\t\t\tfont-size:0.75em;\n\t\t\t\tline-height:1em;\n\t\t\t\tfont-weight:600;\n\t\t\t\toverflow:auto;\n\t\t\t}\n\n\t\t\tpre {\n\t\t\t\tpadding: 20px 0px;\n\t\t\t\tmargin:0;\n\t\t\t\tbackground:#f8f8f8;\n\t\t\t\twidth:100%;\n\t\t\t\toverflow:auto;\n\t\t\t}\n\n\t\t\tcode{\n\t\t\t\tline-height: 1.5em;\n\t\t\t\tfont-size: 1em;\n\t\t\t}\n\n\t\t\tfooter{\n\t\t\t\tbackground: #f8f8f8;\n\t\t\t\tpadding:20px 0px 20px 20px;\n\t\t\t\tborder-top:2px solid #eee;\n\t\t\t}\n\n\t\t\t.version{\n\t\t\t\tbackground: #6b919e;\n\t\t\t\tpadding: 2px 6px;\n\t\t\t\tborder-radius: 3px;\n\t\t\t\tcolor:#FFF;\n\t\t\t\tfont-weight: 300;\n\t\t\t}\n\n\t\t\tul.projects {\n\t\t\t\tpadding: 0;\n\t\t\t}\n\n\t\t\tul.projects li{\n\t\t\t\tlist-style-type:none;\n\t\t\t\tmargin-bottom:10px;\n\t\t\t}\n\n\t\t\tul.projects li a{\n\t\t\t\tbackground: #eee;\n\t\t\t\tpadding:25px 0px 25px 20px;\n\t\t\t\tborder-left: 4px solid #6b919e;\n\t\t\t\tdisplay:block;\n\t\t\t\tborder-radius: 5px;\n\t\t\t\ttext-decoration:none;\n\t\t\t}\n\n\t\t\tul.projects li a h2{\n\t\t\t\tfont-weight:bold;\n\t\t\t\tcolor: #6b919e;\n\t\t\t\tmargin:0px;\n\t\t\t}\n\n\t\t\tul.projects li a code{\n\t\t\t\tmargin:0px;\n\t\t\t\tcolor:#666;\n\t\t\t\ttext-decoration:none;\n\t\t\t}\n\n\t\t\t.center {\n\t\t\t\ttext-align:center;\n\t\t\t\tpadding-top: 100px;\n\t\t\t\tpadding-bottom: 100px;\n\t\t\t}\n\n\tbody\n\t\t!= yield\n\t\tfooter\n\t\t\tp Harp <span class=\"version\">v#{ pkg.version }</span> \n\t\t\t\ta(href=\"http://harpjs.com/docs/\", target=\"_blank\") Documentation\n"
}
I'm not quite sure why it's reporting an error in ./node_modules/harp/lib/templates/_layout.jade. My project does have a _layout.jade in the main directory.
The text was updated successfully, but these errors were encountered:
Oh, it looks like you might have installed Harp locally by mistake, so Harp is trying to compile its own default _layout.jade. Instead of including Harp as a dependency in your package.json (which is really only necessary if you’re using it as middleware), you could add “Install Harp with npm install -g harp to the project Readme.
I’m going to close this, but feel free to post again if you have any more questions about this. Thanks for opening an issue!
I see. It looks like Harp is trying to compile everything in node_modules. I'm getting an error from a different package now that includes some stylesheets.
Is there any way to exclude that directory from harp compile, or do I have to move all the assets I want to compile to a public subdirectory and just compile that?
There’s a PR for that #312 but it breaks many tests. If someone fixes that, I think we might be able to merge it. Otherwise, it’ll be something that gets figured out as part of adding Browserify support, which is also planned.
Getting this strange error when running
harp compile
in my project.I'm not quite sure why it's reporting an error in
./node_modules/harp/lib/templates/_layout.jade
. My project does have a_layout.jade
in the main directory.The text was updated successfully, but these errors were encountered: