Open rustam-mh opened 8 years ago
в каком-то из шаблонов в .match не функция?
Не обязательно в match()
, может быть в любой из «сахарных» функций (tag()
, attrs()
и т.д.).
Могу помочь найти точное места, если опубликуешь собранный бандл и входные данные.
index.bemjson.js:
`module.exports = {block : 'header'};`
bundle.js:
var fs = require('fs'); var path = require('path'); var vm = require('vm'); var vow = require('vow'); var Bundle = function(name, folder){ this.name = name+'.bundles'; this.folder = folder; this.path = path.join(this.name,this.folder,this.folder); this.BEMTREE = this.bemtree(); this.BEMHTML = require('../../../' + this.path + '.bemhtml.js'); }; Bundle.prototype.bemtree = function(){ var bemtreePath = './' + this.path + '.bemtree.js', bemtreeFile = fs.readFileSync(bemtreePath, 'utf-8'), context = vm.createContext({ console: console, Vow: vow, require: require, setImmediate: setImmediate }); vm.runInContext(bemtreeFile, context); return context.BEMTREE; }; module.exports = Bundle;
test.js:
var Bundle = require('../server/libs/bem'); var index = new Bundle('desktop', 'index'); index.BEMTREE.apply({ block: 'header' }).then(function(bemjson){ console.log( index.BEMHTML.apply(bemjson) ); });
throw new Error(msg || 'Assertion failed'); ^
Error: Wrong .match() argument
at assert (/home/rustam/my-bem-project/desktop.bundles/index/index.bemtree.js:1823:11)
at Tree.match (/home/rustam/my-bem-project/desktop.bundles/index/index.bemtree.js:1613:5)
at Object.
я про /home/rustam/my-bem-project/desktop.bundles/index/index.bemtree.js
говорил
var fs = require('fs'), path = require('path'), vm = require('vm'), vow = require('vow');
evalmachine.:1823
throw new Error(msg || 'Assertion failed');
^
Error: Wrong .match() argument at assert (evalmachine.:1823:11)
at Tree.match (evalmachine.:1613:5)
at Object. (evalmachine.:1967:1)
at Tree.build (evalmachine.:1517:13)
at BEMHTML.compile (evalmachine.:372:18)
at buildBemXjst (evalmachine.:1844:5)
at evalmachine.:2080:15
at evalmachine.:2083:3
at Object.exports.runInContext (vm.js:44:17)
at Bundle.bemtree (/home/rustam/www/rhblog/server/libs/bem/index.js:24:5)