{"id":1253,"date":"2022-08-30T15:14:56","date_gmt":"2022-08-30T15:14:56","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/10\/jade-compile-returning-a-function-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:14:56","modified_gmt":"2022-08-30T15:14:56","slug":"jade-compile-returning-a-function-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/jade-compile-returning-a-function-collection-of-common-programming-errors\/","title":{"rendered":"jade.compile returning a function-Collection of common programming errors"},"content":{"rendered":"<p>I want to redo my blog but my code below seems to be returning <code>[function]<\/code> whenever I console.log it. Yes it is the correct path, and it used to work before I updated jade but not anymore.<\/p>\n<pre><code>post.stub = jade.compile(\n        fs.readFileSync(__dirname + '\/blog\/' + p + '\/stub.jade')\n)\n<\/code><\/pre>\n<p>How do I fix this so that <code>console.log(post.stub)<\/code> will return my :markdown present in the jade file instead of <code>[function]<\/code> ?<\/p>\n<p>Thanks in advance.<\/p>\n<p>Updated answer:<\/p>\n<pre><code> post.stub = jade.compile(\n            fs.readFileSync(__dirname + '\/blog\/' + p + '\/stub.jade')\n        )({})\n<\/code><\/pre>\n<p id=\"rop\"><small>Originally posted 2013-11-10 00:12:18. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I want to redo my blog but my code below seems to be returning [function] whenever I console.log it. Yes it is the correct path, and it used to work before I updated jade but not anymore. post.stub = jade.compile( fs.readFileSync(__dirname + &#8216;\/blog\/&#8217; + p + &#8216;\/stub.jade&#8217;) ) How do I fix this so that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1253","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1253"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1253\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}