clux/modul8 — Issue #12: template loading
Author: panosru
Created: 2012-01-23 06:10:06+00:00
State: open

Hello, I'm using Backbone and with RequireJS I used to do `require('text!/path/to/template');` I try to do something similar with modul8. I have set the following in my application:

app.use(
modul8('./app/main.coffee')
.domains({
'BC' : './app/bounded-contexts/',
'IF' : './app/interface/'
})
.npm( './node_modules')
.register('.jade', function (code, bare) {
return jade.compile(code, {});
})
...

So my goal is to be able to call `require('IF::path/to/template.jade');` or `require('IF::path/to/template');` *without .jade extension* the problem here is that when ever I try to run `node app.js` now I get the following error:

node.js:216
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Not a string or buffer
at hash (/home/rnd/domains/design.rnd/public_html/app-ui/node_modules/modul8/node_modules/deputy/index.js:26:39)
at Function.find (/home/rnd/domains/design.rnd/public_html/app-ui/node_modules/modul8/node_modules/deputy/index.js:34:17)
at Analyzer.deputy (/home/rnd/domains/design.rnd/public_html/app-ui/node_modules/modul8/node_modules/deputy/index.js:30:23)
at Analyzer.dependencies (/home/rnd/domains/design.rnd/public_html/app-ui/node_modules/modul8/lib/analyzer.js:50:15)
at Analyzer. (/home/rnd/domains/design.rnd/public_html/app-ui/node_modules/modul8/lib/analyzer.js:95:27)
at Analyzer. (/home/rnd/domains/design.rnd/public_html/app-ui/node_modules/modul8/lib/analyzer.js:116:15)
at Analyzer. (/home/rnd/domains/design.rnd/public_html/app-ui/node_modules/modul8/lib/analyzer.js:116:15)
at Analyzer. (/home/rnd/domains/design.rnd/public_html/app-ui/node_modules/modul8/lib/analyzer.js:116:15)
at Analyzer. (/home/rnd/domains/design.rnd/public_html/app-ui/node_modules/modul8/lib/analyzer.js:116:15)
at Analyzer.buildTree (/home/rnd/domains/design.rnd/public_html/app-ui/node_modules/modul8/lib/analyzer.js:120:9)

Thanks in advance for any help on this issue! :)