2016-01-02 6 views
5

मैं ब्राउज़र के साथ दंगा कस्टम टैग का उपयोग करने की कोशिश कर रहा हूं।दंगा कस्टम टैग्स के साथ ब्राउजरफाइज टाइपिंग त्रुटि

TypeError: Cannot read property 'render' of null while parsing file: /Users/michaelmostachetti/Google_Drive/dev/web/mike_mostachetti_site/app/views/blog.tag 
at _html.jade (/Users/michaelmostachetti/Google_Drive/dev/web/mike_mostachetti_site/node_modules/riot/node_modules/riot-compiler/dist/compiler.js:58:26) 
at compileTemplate (/Users/michaelmostachetti/Google_Drive/dev/web/mike_mostachetti_site/node_modules/riot/node_modules/riot-compiler/dist/compiler.js:692:10) 
at Object.compile (/Users/michaelmostachetti/Google_Drive/dev/web/mike_mostachetti_site/node_modules/riot/node_modules/riot-compiler/dist/compiler.js:717:11) 
at Stream.<anonymous> (/Users/michaelmostachetti/Google_Drive/dev/web/mike_mostachetti_site/node_modules/riotify/index.js:16:58) 
at _end (/Users/michaelmostachetti/Google_Drive/dev/web/mike_mostachetti_site/node_modules/riotify/node_modules/through/index.js:65:9) 
at Stream.stream.end (/Users/michaelmostachetti/Google_Drive/dev/web/mike_mostachetti_site/node_modules/riotify/node_modules/through/index.js:74:5) 
at DestroyableTransform.onend (/Users/michaelmostachetti/npm-global/lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_readable.js:545:10) 
at DestroyableTransform.g (events.js:260:16) 
at emitNone (events.js:72:20) 
at DestroyableTransform.emit (events.js:166:7) 

यहाँ मेरी package.json

"browserify": { 
    "transform": [ 
     [ 
     "riotify", 
     { 
       "template": "jade" 
     } 
     ] 
    ] 
} 

है यहाँ मेरी index.js है।

var riot  = require('riot'), 
    blogView = require('./views/blog.tag'); 

riot.mount(blogView); 

मैं सिर्फ त्रुटि से उलझन में हूं और क्या गलत हो रहा है। मैं किसी भी मुद्दे के बिना जेड को एचटीएमएल में संकलित कर सकता हूं। दस्तावेज़ों में उदाहरण यहां दिया गया है। https://github.com/jhthorsen/riotify#usage

उत्तर

2

ऐसा इसलिए हो सकता है क्योंकि निर्भरता jade स्थापित नहीं है। मैं सिर्फ इतना है कि त्रुटि के स्टैक ट्रेस की जाँच की है और यह इस लाइन के लिए अंक:

return _req('jade').render(html, extend({ 

तो jade जोड़ने का प्रयास करें और उसे फिर से चल रहा है।

+2

वास्तव में, जब तक आपको HTML को पूर्व-संसाधित करने की आवश्यकता नहीं है (मैंने नहीं किया) तो आप 'टेम्पलेट' विकल्प से छुटकारा पा सकते हैं। –

संबंधित मुद्दे