当前位置:  开发笔记 > 编程语言 > 正文

Browserify with Riot Custom Tags给出类型错误

如何解决《BrowserifywithRiotCustomTags给出类型错误》经验,为你挑选了0个好方法。

我正在尝试使用browserify的防暴自定义标签.

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. (/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);

我只是对错误和出了什么问题感到困惑.我可以将jade编译成html而不会有任何问题.这是文档中的示例.https://github.com/jhthorsen/riotify#usage

推荐阅读
Gbom2402851125
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有